- Upgrade node-java-caller to fix bug with
npm-groovy-lint --version
on linux
- Add module declaration
- Fix crash in case of parsing error (#406)
- Disable codecov
- Convert to ES Module
- Upgrade to CodeNarc 3.5.0
- Upgrade NodeJs to minimum version 20
- Setup renovate
- Upgrade dependencies, including base package node-java-caller
- Upgrade MegaLinter to v8
- Remove decode-html-entities dependency
- Upgrade node-java-caller to v4 to solve issues with Mac
- Change license to MIT
- Upgrade tar to avoid CVE
- Remove amplitude dependency and anonymous telemetry
- Upgrade amplitude dependency
- Remove markdown links checks in internal CI (requirement covered by lychee)
- Fix issue with anonymous telemetry
- Fix #351: temp directories aren't cleaned up
- Fix
console.warning is not a function
- fix: class not found request failure
- fix: missing parse errors with --noserver
- Deactivate log file by default
- fix: analytics send failure error
- Fix data race on stdout capture which was corrupting the responses for overlapping requests by using a capturing plugin.
- Fix data race on threads read and write which could result in missed cancellations and re-enable cancellation processing.
- Ensure that threads are always removed in the case of write response exception.
- Switch to jackson to enable efficient JSON encoding and decoding including raw embedding of CodeNarc result to avoid unnecessary processing.
- Split out HTTP filters to their own files.
- Use typed variables instead of def per linter recommendation.
- Add early test for missing base directory to avoid running linter unnecessarily.
- Fix parse failures for files which contain classes that only non-zero argument constructors.
- Add gzip compression to reduce size of network traffic to improve performance
- CI: Enhance MegaLinter config
- CI: Upload expected sources as artifact if Check for changes job fails
- Remove useless console.log in sources.
- Update logback to 1.4.14 to address cve-2023-6378
-
BREAKING CHANGE: Upgrade CodeNarc to v3.4.0-alpha+3346775f
-
Major core architecture refactoring by the great Steven Hartland
-
Fix files specified on the command line not linting as expected due to the generated patterns not working as intended if relative path that contains a file and not a directory due to an issue with CodeNarc pattern processing.
-
Fix incompatible arguments passed to CodeNarc by:
- Using arrays internally to avoid issues with spaces in arguments being interpreted incorrectly.
- Stripping all quotes from string arguments as CodeNarc doesn't handle them correctly.
- Enable automatic argument quoting on Windows.
-
Fix command line -ext extensions not being processed correctly and matching too many files as it was missing the prefix.
-
Ensure readFile and writeFile calls produce a stack trace on failure due to: nodejs/node#30944.
-
Fix file delete race condition and variable clean up due to missing await.
-
Fix use of includes instead of exclude parameters.
-
-
Also:
- Fixed Request failed logging
- Fix README.md typo
- Add additional useful debug logging
- Run dev:pre-commit to update CHANGELOG.md
- Add more cspell entries
- Add missing items to CodeNarcServer.groovy usage
- Re-enable tests which are now fixed
- Override axios for security patch
Steven Hartland now becomes an official maintainer of npm-groovy-lint and vscode-groovy-lint !
- Upgrade java-caller dependency to 3.2.0 (Now handles Mac M1)
- Output issue when error collecting CodeNarc version
- Revert update that output json when not requested
- Upgrade node-java-caller to v3.1.1
- Upgrade node-java-caller to v3.1.0
- Fix: bump openjdk version from 11 to 17 in Docker image by @SerhiiKorolik in #317
Many fixes, including an issue with IPV6 that made npm-groovy-lint crash on many machines, has been fixed by @stevenh ! Many thanks to him !
Breaking change: Minimum java version to Java 17
- Use MegaLinter v7 by @nvuillam in #254
- Bump json5 from 2.2.1 to 2.2.3 by @dependabot in #260
- ci: fix action failures by @stevenh in #309
- chore: update node to 18 lts by @stevenh in #310
- feat: improve the vscode deployment by @stevenh in #307
- Improve publish via CI + beta when in main by @nvuillam in #311
- chore: improve flow debugging by @stevenh in #303
- ci: predictable server builds and port option by @stevenh in #312
- fix: status bar message by @stevenh in #302
- fix: server and test stability by @stevenh in #313
- fix: UnnecessaryGString for strings with slashes by @stevenh in #304
- Fix npm dependency minimatch
- Provide default range when only information available is a line number (#248)
- New CodeNarc issues definition to calculate range in file
- GStringExpressionWithinString
- VariableName
- BREAKING CHANGE:
--failon
is nowìnfo
by default, meaning exit code will be1
if there is at least an info issue found. To have previous behaviour, use--failon none
. - Display all files in console log only if
--verbose
is used (#243)
- Allow to send groovy sources as input from stdin
- If
--format
or--fix
option is used when source is sent as stdin, the result is output as stdout
Example: cat path/to/my/Jenkinsfile | npm-groovy-lint --format -
- Do not output results summary in console logs when output is json or sarif
- Add test methods for SARIF called by CLI
- Fix error when absolute files sent as positional arguments on a linux system (#232)
- Improve performances by calculating the longest command directory to send as base path to CodeNarc
- Fix error when files sent as positional arguments (#232)
-
Core
- Upgrade to CodeNarc v3.1.0
- Accept list of directories / files as arguments (
--path
and--files
become deprecated but are still usable)- Examples
- Multiple files:
npm-groovy-lint path/to/file1.groovy path/to/file2.groovy
- Directory:
npm groovy-lint path/to
- Single file:
npm-groovy-lint Jenkinsfile
- Ant pattern(s):
npm-groovy-lint path/to/**/*.groovy
- Multiple files:
- Examples
- Upgrade npm dependencies
- CI: Upgrade MegaLinter to v6
- Test classes for collecting error ranges
-
New error ranges rules
- DuplicateNumberLiteral
- DuplicateStringLiteral
- MethodParameterTypeRequired
- NoDef
- SimpleDateFormatMissingLocale
- SpaceInsideParenthesis
- UnnecessaryPublicModifier
- VariableTypeRequired
-
New fix rules
- SpaceAfterMethodCallName
- SpaceInsideParentheses
-
Bug Fixes
- Wrongly calculated ranges are no more returned
- Disable Amplitude anonymous stats by default (use
--insight
to enable them)
- Upgrade node-sarif-builder to 2.0.1 and send npm-groovy-lint version in SARIF logs
- New range detection for rules:
- MethodReturnTypeRequired
- UnusedImport
- Add SARIF output format using node-sarif-builder
- Upgrade cli-progress to avoid colors lib boring but harmless hack
- Fix issue when used as module and with file containing spaces (VsCodeGroovyLint #137)
- Upgrade log4j dependencies because of security issue.
- Upgrade log4j dependencies because of (another) security issue (#196)
- Upgrade log4j dependencies because of security issue (#194)
- Upgrade to CodeNarc v2.2.0
- Upgrade to Groovy v3.0.9
- 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
- Upgrade dependencies advised by dependabot
- Fix Mega-Linter errors found
- Exclude
UnnecessaryGetter
,FactoryMethodName
,MethodReturnTypeRequired
, andGStringExpressionWithinString
inrecommended-jenkinsfile
(#140) (Felipe Santos)
- Fix documentation about --verbose and --version options
- Use GitHub action to deploy to NPM
- Add a test case where variable includes if in its name for fix of rule SpaceAfterIf (Behlül Uçar)
- Upgrade to CodeNarc 2.0.0
- Upgrade jars
- Adapt Indentation rule to new behaviour
- Use codenarc --ruleset argument instead of temp ruleset file
- Replace super-linter by Mega-Linter
- Fixes
- (#127) Formatting breaks code, converting
else if
intoelseif
in some cases - Apply formatting rules also for --fix mode
- Fix Markdown dead links
- (#127) Formatting breaks code, converting
- CI
- Migrate from CircleCI to GitHub Actions: now tests are on Linux, Windows & MacOs
- Activate spelling linter of Mega-Linter (+
.cspell.json
file) - Add test cases for format and fix using CLI
- Disable TrailingComma rule by default until crash is solved in CodeNarc (#75@vscode-groovy-lint)
- Add GitHub Action GitHub Super-Linter to the repository
- Update Dockerfile to pass Docker lint rules
- Upgrade java-caller to v2.2.3
- Fix Java 8 detection (#101)
- Update frameworks detection
- Fix (#96) --fix adds redundant space into
${VARIABLE}
(SpaceBeforeOpeningBrace fix rule error) - Fix grails framework detection
- Fix Groovy parsing parsing when multiple files
- Add
.gvy
and.nf
in default browsed files extensions
- Add anonymous framework usage stats for Groovy core Team
- Upgrade java-caller to v2.2.0
- Fix CLASSPATH on windows in case there are spaces in paths
- Fix (#90) When log level is specified number of linted files appear to be off
- (#87) update to openjdk 11 in official Docker image (by Pawel Kopka)
- Add number of lines & reorganize anonymous statistics
- Fix error type counters in anonymous statistics
- Allow to link to CodeNarc RuleSet files from
.groovylintrc.json
, using property"codenarcRulesets"
. Warning: doing so means that all other properties of config file will be ignored.
- Upgrade java-caller to v2.0.0
- Externalize JavaCaller class into a separate package java-caller and use it
- New default recommended rules (activate/deactivate/change severity)
- Allow to call
--config recommended-jenkinsfile
to use delivered .groovylintrc-recommended-jenkinsfile.json
- Fix SpaceAfterComma auto-fixing rule
- Java 14 compatibility (Closes #77)
- Upgrade to CodeNarc v1.6.1
- Update list of rules
- Use new CodeNarc JSON console Output instead of temporary XML files
- Call CodeNarc to get its version instead of using npm-groovy-lint hardcoded value
- Upgrade to GMetrics v1.1
- Upgrade to Groovy v3.0.5
- Add anonymous usage stats on types of errors found and fixed
- Fix & enhance anonymous statistics
Fixes:
- (#62) using a codenarc ruleset file seems to fail / groovylintrc is not codenarc compatible
- (#68) Generate a ready-to-use docker image when publishing new npm-groovy-lint version (by Dave Gallant)
- Fixes
- (#64) The contents of a string gets formatted unexpectedly
- Allow to override java executable and options (#54)
- CodeNarcServer listens to localhost only (#59) solving (#56)
- Replace @analytics/segment with @amplitude/node for anonymous stats
- New option --failon , replacing
--failonerror
,--failonwarning
and--failoninfo
. It can take error, warning or info values (default: none). Previous options remain working but are deprecated and will be removed in a future major version - Update help for
--fixrules
option
- Install Java 8 using node-jre in case java version found is higher than Java 11 (CodeNarc compatibility is Java 8 to 11)
- Updated fix rules
- Indentation
- IndentationClosingBrace
- Avoid to apply wrong fix in case of CodeNarc false positive
- New fix rules
- BlankLineBeforePackage
- Updated fix rules
- BracesForIfElse
- BracesForMethod
- BracesForTryCatchFinally
- ClassEndsWithBlankLine
- ClassStartsWithBlankLine
- MissingBlankLineAfterImports
- MissingBlankLineAfterPackage
- UnnecessaryGroovyImport
- UnusedImport
- BIG BANG: Improve performances, compatibility, architecture and delivery
- Send rule configuration to fix functions
- Add
.gradle
files in default linted files - Fixes:
- Missing number of linted files returned in summary
- Try to call CodeNarcJava in case there is an error with CodeNarcServer call
- Manage to send options for rules sent in
rulesets
: Ex:Indentation{"spacesPerIndentLevel":2,"severity":"warning"},UnnecessarySemicolon
- New parameter
--rulesetsoverridetype
: If list of rules sent in rulesets option, defines if they replace rules defined in .groovylintrc.json, or if they are appended
- Improve performances and avoid
Unknown command: node
error by using childProcess.fork to call CodeNarcServer
- Detect when crash is related to "node" or "java" command not found and return a human readable error message
- Add CI , rule overrides and crashes in anonymous insights for debugging investigation
- When used as a module, never crash intentionally with throw, so when called by module, check linter.status and linter.error instead of try/catch
- 0: ok
- 1: expected error
- 2: unexpected error
- 9: if cancelled request
- Update analytics to use analytics & @analytics-segment instead of insight. If you want to disable anonymous usage stats, you can still use
--no-insight
option.
- Add anonymous usage statistics using insight, in order to make new improvements based on how users use this package.
- Note: Analytics obviously does not receive sensitive information like your code, as you can see in analytics.js. If you want to disable anonymous usage stats, use
--no-insight
option.
- Note: Analytics obviously does not receive sensitive information like your code, as you can see in analytics.js. If you want to disable anonymous usage stats, use
-
New fix rules
- AssignmentInConditional
- DuplicateImport
- ExplicitLinkedListInstantiation
- InsecureRandom
- UnnecessaryDefInVariableDeclaration
- UnnecessaryDotClass
- UnnecessaryFinalOnPrivateMethod
- UnnecessaryInstantiationToGetClass
-
Updated fix rules
- BracesForForLoop: False positive triggering messy code after fixing
- UnnecessaryGString: Fix multiline replacements (
"""
by'''
)
-
Fixes :
- Launch JVM with high memory (
-Xms256m -Xmx2048m
) to improve performances on big files - Increase CodeNarcServ call timeout (+ Manage ETIMEOUT as result, not only ECONNREFUSED )
- Launch JVM with high memory (
-
Utils
- Allow regex in range functions
-
New fix rules
- BracesForClass
- BracesForForLoop
- BracesForIfElse
- BracesForMethod
- BracesForTryCatchFinally
- ExplicitArrayListInstantiation
- MissingBlankLineAfterImports
- MissingBlankLineAfterPackage
-
Updated fix rules
- UnnecessaryGString: Fix replacements containing
\n
and\r
- UnnecessaryGString: Fix replacements containing
-
New fix rules
- SpaceBeforeClosingBrace
- UnnecessaryDefInMethodDeclaration
- UnnecessaryPackageReference
- UnnecessaryParenthesesForMethodCallWithClosure
-
Updated fix rules
- MisorderedStaticImports: Fix
@Grapes
killer fixing rule - ElseBlockBrace :issue when instruction is on the same line than
else
- MisorderedStaticImports: Fix
- Fixes
- ignorepattern option not working #34
- Expose
loadConfig()
method to load rules when npm-groovy-lint is used as a library - Fixes
- Missing temporary rulesets file missing
- Handle better CodeNarcServer concurrent calls
- Fixes
- Take in account user overridden indentation space (and other rules) when using --format option #31
- Configuration updates (#29):
- New default config "recommended-jenkinsfile". Use it with argument
--config recommended-jenkinsfile
- Allow to directly target a config file name. Use it with argument
--config /my/custom/path/.groovylintrc-custom-name.json
- Allow to send a string key that will be used to find config file
--config custom-name
- New default config "recommended-jenkinsfile". Use it with argument
- Updated fix rules:
- IfStatementBraces
- ElseStatementBraces
- Fixes:
- CodeNarcServer: Use cachedThreadPool instead of fixedThreadPool
- Cancel a CodeNarc Lint when a similar CodeNarcServer request is received (allowing onType mode for language servers)
- Allow to disable rules using comments in source in eslint style
- New option --parse: Capability to parse source code and return compilation errors
- New fix rules (thanks CatSue !):
- SpaceAfterSemicolon
- SpaceAfterWhile
- Upgrade to Groovy 3.0.3
- Automatic generation of fixable rules list for README
- Refactor CodeNarcServer.groovy
- Fix issue affecting performances on Linux and MacOs
- When formatting, always run some custom npm-groovy-lint fix rules not corresponding to CodeNarc violations
- Return CodeNarc and Groovy versions when --version options is called
- Fixes
- Lost indentation when applying some fix rules
- Updated fix rules:
- IndentationClosingBraces
- IndentationComments
- SpaceAfterCatch
- SpaceAfterIf
- New fix rules:
- ClassEndsWithBlankLine
- ClassStartsWithNewLine
- SpaceAfterFor
- SpaceAfterSwitch
- Error message in postinstall if env Node.js is lower than the minimal required (12)
- When If or Else brackets are fixed,trigger another rule lint & fix only with Indentation rules so CodeNarc recalculate them correctly
- New option
nolintafter
: When format or fix is called, a new lint is performed after the fixes to update the error list. If you just want the updated source code and do not care about the error logs, use this parameter to improve performances - Fixes
- Manage correctly options
failonerror
,failonwarning
andfailoninfo
npm-groovy-lint -version
now returns version from package.json
- Manage correctly options
- Mocha tests updates:
- Add stats on calls to CodeNarc (
globalThis.codeNarcCallsCounter
andglobalThis.codeNarcCalls
, activated ifglobalThis.codeNarcCallsCounter
is set to 0 before calling NmpGroovyLint) - Factorize test classes common code in module helper/common.js
- Use a smaller groovy file for test classes when not impacting the tests quality
- Add stats on calls to CodeNarc (
- New option returnrules if you want to return rules descriptions and documentation url in results
- Use npm ci instead of npm install in CircleCI build
- Return rules descriptions in results
- New option nolintafter: do not lint again a format or a fix, as the client prefers to request it
- Fixes
- Issue #13: False positive error ClassNameSameAsFileName
- Sometimes returning wrong .groovylint.json config file
- New option "--format", allowing to reformat source code (using .groovylintrc-format.json)
- Update default recommended rules
- README: Link to Visual Studio Code Groovy Lint extension
- New Fix rules:
- BlockEndsWithBlankLine
- BlockStartsWithBlankLine
- MisorderedStaticImports
- SpaceAfterIf
- Fix: Update correctly the lineNb & ranges of next errors after an error has been fixed
- Do not return rules tests if call is not from a test file
- Fix rules:
- ElseBlockBraces
- IfStatementBraces
- SpaceAroundOperator
- UnusedImport
- New Fix rules:
- BlockEndsWithBlankLine
- BlockStartsWithBlankLine
- MisorderedStaticImports
- SpaceAfterIf
- Updated Fix rules:
- SpaceAroundOperator
- Test suites: Improve reliability & logs for rule fixes tests (detected numerous bugs, now corrected)
- Send computed range to fix functions
- Updated Fix rules:
- ClosingBraceNotAlone
- ElseBlockBraces
- IfStatementBraces
- NoTabCharacter
- SpaceAfterComma
- SystemExit
- TrailingWhitespace
- UnnecessaryGroovyImport
- UnusedImport
- Add new test suites: errors.test.js and miscellaneous.test.js
- Use JSON as default GroovyLint configuration file type
- Order of fixable rules must be defined in groovy-lint-rules.js
- Do not load rules test data except during tests
- Do not lint again after a call to fixErrors on an existing NpmGroovyLint instance (except if lintAgainAfterFix : true is sent in options)
- Fix: Deletion of temp RuleSite file
- Fix: UnnecessarySemiColon rule
- Fix: ClosingBraceNotAlone rule
- Local microservice "CodeNarcServer" called via Http by npm-groovy-lint, to avoid loading all groovy/java classes at each lint request. This microservice auto-kills itself after one hour idle.
- Capability to define RuleSets in argument or js/json/yml config file formats instead of groovy/xml RuleSet format
- Test classes for rules fix (before / after fix defined in rule definitions)
- Add debug logs (use it by setting DEBUG env variable , ex:
DEBUG=npm-groovy-lint npm-groovy-lint args...
) - Update lines and ranges of other errors after a fix updated the number of lines
- Generate automatically .groovylintrc-all.js during build
- Split rules definition into files instead of all in a huge single file
- Reorganize groovy-lint.js code, using codenarc-factory.js and codenarc-caller.js
- New lib utils.js that can be used by rules definition
- Fix: Crash when there was no error found in a file
- Fix: Remove Promise error display in log after launching CodeNarcServer
- Fix: Add more options exclusivity arguments rules
- Removed "Groovy", "Jenkinsfile" and "All" identifiers for --rulesets arguments. Please now use .groovylintrc.js configuration
- Capability to call NpmGroovyLint with options as object, not only command line arguments
- New option "source", allowing to call NpmGroovyLint with the groovy code as a string , not only path & files pattern
- Run lint again after fix all errors, to get updated lintResult
- Add gitattributes to normalized line-endings (thanks docwhat)
- API: fix only some errors after an initial lint (better performances)
- Return error range in files for some rules in JSON or API result (will be useful for the VsCode extension currently developed)
- Define range function for existing rules, new fixable rules
- Capability to fix errors
- ConsecutiveBlankLines
- Indentation (IfStatementBraces and ElseIfStatementBraces must be manually fixed to have correct indentation)
- IndentationComments (custom npm-groovy-rule triggered by Indentation rule)
- IndentationClosingBrace (custom npm-groovy-rule triggered by Indentation rule)
- NoTabCharacter
- SpaceAfterCatch
- SpaceAfterOpeningBrace
- SpaceAroundOperator
- SpaceAfterComma
- SpaceBeforeOpeningBrace
- UnnecessaryDefInFieldDeclaration
- UnnecessaryGString
- UnnecessaryPublicModifier
- UnnecessarySemicolon
- TrailingWhitespace
- ConsecutiveBlankLines
- Log formatting with severity colors and summary table
- Default recommended RuleSets for Groovy and Jenkins
- Progress bar in console
- More code coverage with test campaigns
- New Capability to call NpmGroovyLint from another package (VsCode extension development in progress ^^)
- Refactored command line arguments ( simpler, but different from CodeNarc ones : retro-compatibility with CodeNarc arguments assured if you add --codenarcargs)
- Upgrade to CodeNarc v1.5
- Upgrade to Groovy v3.0.1
- Refactored documentation with detailed arguments description & examples
- I wasn't serious enough to keep a changelog, sorry !