npm-groovy-lint
Advanced tools
Comparing version 8.2.0 to 9.0.0
# Changelog | ||
## [8.2.0] 2020-12-14 | ||
## UNRELEASED | ||
## [9.0.0] 2021-09-30 | ||
- Upgrade to [CodeNarc v2.2.0](https://github.com/CodeNarc/CodeNarc/releases/tag/v2.2.0) | ||
- Upgrade to [Groovy v3.0.9](https://groovy-lang.org/) | ||
- Reorganize sources test folder | ||
- Use java from 8 to 14 (install it if a later version is found) | ||
- Add timeouts in CI jobs | ||
- Add colors in error logs | ||
## [8.2.0] 2021-06-11 | ||
- Upgrade dependencies advised by dependabot | ||
@@ -6,0 +17,0 @@ - Fix Mega-Linter errors found |
@@ -42,2 +42,3 @@ { | ||
"basic.MultipleUnaryOperators": {}, | ||
"basic.ParameterAssignmentInFilterClosure": {}, | ||
"basic.RandomDoubleCoercedToZero": {}, | ||
@@ -189,2 +190,3 @@ "basic.RemoveAllOnSelf": {}, | ||
"formatting.MissingBlankLineAfterPackage": {}, | ||
"formatting.MissingBlankLineBeforeAnnotatedField": {}, | ||
"formatting.SpaceAfterCatch": {}, | ||
@@ -195,2 +197,5 @@ "formatting.SpaceAfterClosingBrace": {}, | ||
"formatting.SpaceAfterIf": {}, | ||
"formatting.SpaceAfterMethodCallName": {}, | ||
"formatting.SpaceAfterMethodDeclarationName": {}, | ||
"formatting.SpaceAfterNotOperator": {}, | ||
"formatting.SpaceAfterOpeningBrace": {}, | ||
@@ -205,2 +210,3 @@ "formatting.SpaceAfterSemicolon": {}, | ||
"formatting.SpaceBeforeOpeningBrace": {}, | ||
"formatting.SpaceInsideParentheses": {}, | ||
"formatting.TrailingWhitespace": {}, | ||
@@ -207,0 +213,0 @@ "generic.IllegalClassMember": {}, |
@@ -9,2 +9,3 @@ // Call CodeNarc by server or java | ||
const { getSourceLines } = require("./utils"); | ||
const c = require("chalk"); | ||
@@ -31,2 +32,3 @@ class CodeNarcCaller { | ||
minimumJavaVersion: 8, | ||
maximumJavaVersion: 14, | ||
rootPath: __dirname, | ||
@@ -38,6 +40,7 @@ mainClass: "com.nvuillam.CodeNarcServer", | ||
minimumJavaVersion: 8, | ||
maximumJavaVersion: 14, | ||
rootPath: __dirname, | ||
mainClass: "org.codenarc.CodeNarc", | ||
classPath: | ||
"java/CodeNarc-2.0.0.jar:java/groovy/lib/groovy-3.0.5.jar:java/groovy/lib/groovy-templates-3.0.5.jar:java/groovy/lib/groovy-xml-3.0.5.jar:java/groovy/lib/groovy-json-3.0.5.jar:java/groovy/lib/groovy-ant-3.0.5.jar:java/groovy/lib/ant-1.10.8.jar:java/groovy/lib/ant-launcher-1.10.8.jar:java/slf4j-api-1.7.9.jar:java/log4j-slf4j-impl-2.13.0.jar:java/log4j-api-2.13.0.jar:java/log4j-core-2.13.0.jar:java/gmetrics-1.1.jar:java/*" | ||
"java/CodeNarc-2.2.0.jar:java/groovy/lib/groovy-3.0.9.jar:java/groovy/lib/groovy-templates-3.0.9.jar:java/groovy/lib/groovy-xml-3.0.9.jar:java/groovy/lib/groovy-json-3.0.9.jar:java/groovy/lib/groovy-ant-3.0.9.jar:java/groovy/lib/ant-1.10.11.jar:java/groovy/lib/ant-launcher-1.10.11.jar:java/slf4j-api-1.7.9.jar:java/log4j-slf4j-impl-2.13.0.jar:java/log4j-api-2.13.0.jar:java/log4j-core-2.13.0.jar:java/gmetrics-1.1.jar:java/*" | ||
} | ||
@@ -108,3 +111,3 @@ }; | ||
} else { | ||
console.error( | ||
console.error(c.red( | ||
"CodeNarcServer unexpected error:\n" + | ||
@@ -114,3 +117,3 @@ JSON.stringify(e, null, 2) + | ||
(e.response && e.response.data && e.response.data.errorDtl ? JSON.stringify(e.response.data.errorDtl, null, 2) : undefined) | ||
); | ||
)); | ||
} | ||
@@ -263,3 +266,4 @@ this.serverStatus = "error"; | ||
if ([666, 1].includes(javaCallRes.status)) { | ||
console.error(`Unable to run java command: ${JSON.stringify(javaCallRes)}`); | ||
console.error(c.red(`Unable to start CodeNarc server: ${JSON.stringify(javaCallRes)}`)); | ||
console.error(c.grey(JSON.stringify(scriptArgs))); | ||
this.serverStatus = "error"; | ||
@@ -305,3 +309,3 @@ return false; | ||
if (this.serverStatus === "running") { | ||
console.log(`GroovyLint: Started CodeNarc Server`); | ||
console.log(c.green(`GroovyLint: Started CodeNarc Server`)); | ||
return true; | ||
@@ -322,3 +326,3 @@ } else { | ||
debug(e.message); | ||
console.error(errMsg); | ||
console.error(c.grey(errMsg)); | ||
} | ||
@@ -325,0 +329,0 @@ |
@@ -14,4 +14,4 @@ // Configuration file management | ||
const NPM_GROOVY_LINT_CONSTANTS = { | ||
CodeNarcVersion: "1.6.1", | ||
GroovyVersion: "3.0.5" | ||
CodeNarcVersion: "2.2.0", | ||
GroovyVersion: "3.0.9" | ||
}; | ||
@@ -18,0 +18,0 @@ |
import groovy.json.* | ||
import java.security.SecureRandom | ||
def script = new GroovyScriptEngine( '.' ).with { | ||
loadScriptByName( 'Utils.groovy' ) | ||
} | ||
this.metaClass.mixin script | ||
def returnCode = 0 | ||
@@ -10,0 +5,0 @@ Exception eThrow = null |
import groovy.io.FileType | ||
import groovy.json.* | ||
import groovy.time.TimeCategory | ||
import static groovyx2.gpars.GParsPool.withPool | ||
def script = new GroovyScriptEngine( '.' ).with { | ||
loadScriptByName( 'Utils.groovy' ) | ||
} | ||
this.metaClass.mixin script | ||
def returnCode = 0 | ||
@@ -12,0 +6,0 @@ Exception eThrow = null |
@@ -1,3 +0,1 @@ | ||
#! /usr/bin/env node | ||
// Imports | ||
@@ -4,0 +2,0 @@ const fse = require("fs-extra"); |
@@ -1,3 +0,1 @@ | ||
#! /usr/bin/env node | ||
// Imports | ||
@@ -4,0 +2,0 @@ const debug = require("debug")("npm-groovy-lint"); |
{ | ||
"name": "npm-groovy-lint", | ||
"version": "8.2.0", | ||
"version": "9.0.0", | ||
"description": "Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files", | ||
@@ -8,7 +8,7 @@ "main": "index.js", | ||
"lint:fix": "eslint **/*.js --fix && prettier --write \"./lib/**/*.{js,jsx,json}\" --tab-width 4 --print-width 150", | ||
"groovy:run-server-from-source": "npm run dev:kill-server && groovy -cp \"lib/java/CodeNarc-2.0.0.jar;lib/java/groovy/lib/groovy-3.0.5.jar;lib/java/groovy/lib/groovy-templates-3.0.5.jar;lib/java/groovy/lib/groovy-xml-3.0.5.jar;lib/java/groovy/lib/groovy-json-3.0.5.jar;lib/java/groovy/lib/groovy-ant-3.0.5.jar;lib/java/groovy/lib/ant-1.10.8.jar;lib/java/groovy/lib/ant-launcher-1.10.8.jar;lib/java/slf4j-api-1.7.9.jar;lib/java/log4j-slf4j-impl-2.13.0.jar;lib/java/log4j-api-2.13.0.jar;lib/java/log4j-core-2.13.0.jar;lib/java/gmetrics-1.1.jar\" groovy/src/main/com/nvuillam/CodeNarcServer.groovy --server", | ||
"groovy:run-server-from-source": "npm run dev:kill-server && groovy -cp \"lib/java/CodeNarc-2.2.0.jar;lib/java/groovy/lib/groovy-3.0.9.jar;lib/java/groovy/lib/groovy-templates-3.0.9.jar;lib/java/groovy/lib/groovy-xml-3.0.9.jar;lib/java/groovy/lib/groovy-json-3.0.9.jar;lib/java/groovy/lib/groovy-ant-3.0.9.jar;lib/java/groovy/lib/ant-1.10.11.jar;lib/java/groovy/lib/ant-launcher-1.10.11.jar;lib/java/slf4j-api-1.7.9.jar;lib/java/log4j-slf4j-impl-2.13.0.jar;lib/java/log4j-api-2.13.0.jar;lib/java/log4j-core-2.13.0.jar;lib/java/gmetrics-1.1.jar\" groovy/src/main/com/nvuillam/CodeNarcServer.groovy --server", | ||
"groovy:build": "npm run dev:kill-server && groovyc -cp \"./lib/java*\" --encoding utf-8 ./groovy/src/main/com/nvuillam/CodeNarcServer.groovy -d ./tmp && cd ./tmp && jar -cvfm ./../lib/java/CodeNarcServer.jar ./../MANIFEST.txt ./com/nvuillam/*.class && cd ..", | ||
"test": "npm run dev:kill-server && mocha \"lib/test/**/*.test.js\"", | ||
"test": "npm run dev:kill-server && mocha \"test/**/*.test.js\"", | ||
"test:coverage": "nyc npm run test", | ||
"test:debug": "npm run dev:kill-server && mocha --reporter spec --inspect-brk \"lib/test/**/*.test.js\"", | ||
"test:debug": "npm run dev:kill-server && mocha --reporter spec --inspect-brk \"test/**/*.test.js\"", | ||
"build": "node script-build-config-all.js && cp -f README.md docs/index.md && cp -f CHANGELOG.md docs/CHANGELOG.md", | ||
@@ -48,5 +48,6 @@ "dev:kill-server": "npm-groovy-lint --killserver", | ||
"dependencies": { | ||
"amplitude": "^5.1.2", | ||
"amplitude": "^5.1.6", | ||
"ansi-colors": "^4.1.1", | ||
"axios": "^0.21.1", | ||
"chalk": "^4.1.2", | ||
"cli-progress": "^3.6.0", | ||
@@ -77,3 +78,3 @@ "debug": "^4.1.1", | ||
"mocha": "^7.0.1", | ||
"nyc": "^15.0.0-beta.3", | ||
"nyc": "^15.1.0", | ||
"prettier": "1.19.1", | ||
@@ -88,3 +89,3 @@ "rimraf": "^3.0.2", | ||
"require": [ | ||
"lib/test/helpers/init.js" | ||
"test/helpers/init.js" | ||
], | ||
@@ -91,0 +92,0 @@ "watch-extensions": [ |
@@ -76,5 +76,6 @@ <!-- markdownlint-disable MD013 MD033 MD034 --> | ||
``` | ||
- If you have issues with v9, install previous version with `npm install -g npm-groovy-lint@8.2.0` | ||
- Node.js >= 12 is required to run this package. If you can't upgrade, you can use [nvm](https://github.com/nvm-sh/nvm) to have [different node versions on your computer](https://www.sitepoint.com/quick-tip-multiple-versions-node-nvm/) | ||
- If you do not have java (from 8 to 14) installed on your computer npm-groovy-lint will install them for you, so the first run may be long. | ||
Node.js >= 12 is required to run this package. If you can't upgrade, you can use [nvm](https://github.com/nvm-sh/nvm) to have [different node versions on your computer](https://www.sitepoint.com/quick-tip-multiple-versions-node-nvm/) | ||
## Configuration | ||
@@ -371,3 +372,3 @@ | ||
```javascript | ||
const NpmGroovyLint = require("npm-groovy-lint/groovy-lint.js"); | ||
const NpmGroovyLint = require("npm-groovy-lint/lib/groovy-lint.js"); | ||
const fse = require("fs-extra"); | ||
@@ -374,0 +375,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
16847271
411
19
0
18
109
6815
+ Addedchalk@^4.1.2
+ Addedansi-styles@4.3.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedsupports-color@7.2.0(transitive)
Updatedamplitude@^5.1.6