npm-groovy-lint
Advanced tools
Comparing version 2.0.1 to 2.2.0-beta.1
@@ -66,3 +66,3 @@ #! /usr/bin/env node | ||
// Manage when the user wants to use only codenarc args | ||
if (this.args.includes("--codenarcargs")) { | ||
if (Array.isArray(this.args) && this.args.includes("--codenarcargs")) { | ||
this.codenarcArgs = this.args.slice(2).filter(userArg => userArg !== "--codenarcargs"); | ||
@@ -104,6 +104,6 @@ this.onlyCodeNarc = true; | ||
const baseBefore = | ||
(this.options.path != "." && this.options.path.startsWith("/")) || this.options.path.includes(":/") || this.options.path.includes(":\\") | ||
(this.options.path !== "." && this.options.path.startsWith("/")) || this.options.path.includes(":/") || this.options.path.includes(":\\") | ||
? "" | ||
: process.cwd() + "/"; | ||
this.codeNarcBaseDir = this.options.path != "." ? baseBefore + this.options.path.replace(/^"(.*)"$/, "$1") : process.cwd(); | ||
this.codeNarcBaseDir = this.options.path !== "." ? baseBefore + this.options.path.replace(/^"(.*)"$/, "$1") : process.cwd(); | ||
this.codenarcArgs.push('-basedir="' + this.codeNarcBaseDir + '"'); | ||
@@ -139,7 +139,7 @@ | ||
this.output = this.options.output.replace(/^"(.*)"$/, "$1"); | ||
if (this.output.includes(".txt")) { | ||
if (this.output.includes(".txt") || this.output === "none") { | ||
// Disable ansi colors if output in txt file | ||
c.enabled = false; | ||
} | ||
if (["txt", "json"].includes(this.output) || this.output.endsWith(".txt") || this.output.endsWith(".json")) { | ||
if (["txt", "json", "none"].includes(this.output) || this.output.endsWith(".txt") || this.output.endsWith(".json")) { | ||
this.outputType = this.output.endsWith(".txt") ? "txt" : this.output.endsWith(".json") ? "json" : this.output; | ||
@@ -172,3 +172,4 @@ this.codenarcArgs.push('-report=xml:"' + this.tmpXmlFileName + '"'); | ||
// Build jdeploy codenarc command , filter non-codenarc arguments | ||
const jDeployCommand = '"' + this.args[0] + '" "' + this.jdeployRootPath.trim() + "/" + this.jdeployFile + '" ' + this.codenarcArgs.join(" "); | ||
const nodeExe = this.args[0] && this.args[0].includes("node") ? this.args[0] : "node"; | ||
const jDeployCommand = '"' + nodeExe + '" "' + this.jdeployRootPath.trim() + "/" + this.jdeployFile + '" ' + this.codenarcArgs.join(" "); | ||
@@ -276,13 +277,13 @@ // Start progress bar | ||
id: errId, | ||
line: violation["$"].lineNumber, | ||
line: violation["$"].lineNumber ? parseInt(violation["$"].lineNumber, 10) : null, | ||
rule: violation["$"].ruleName, | ||
severity: | ||
violation["$"].priority == "1" | ||
violation["$"].priority === "1" | ||
? "error" | ||
: violation["$"].priority == "2" | ||
: violation["$"].priority === "2" | ||
? "warning" | ||
: violation["$"].priority == "3" | ||
: violation["$"].priority === "3" | ||
? "info" | ||
: "unknown", | ||
msg: violation.Message ? violation.Message[0] : "NGL: No message" | ||
msg: violation.Message ? violation.Message[0] : "" | ||
}; | ||
@@ -289,0 +290,0 @@ // Add error only if severity is matching logLevel |
{ | ||
"name": "npm-groovy-lint", | ||
"version": "2.0.1", | ||
"version": "2.2.0-beta.1", | ||
"description": "NPM CodeNarc wrapper to easily lint Groovy files", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15899497
1322
1