Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
npm-groovy-lint
Advanced tools
Groovy / Jenkinsfile linter and autofixer
Based on CodeNarc , this out of the box package allows to track groovy errors and correct a part of them
Use option --fix to activate autofixing (mostly formatting rules for now)
Easy to integrate in a CD/CI process (Jenkins Pipeline,CircleCI...) to lint your groovy or Jenkinsfile at each build :)
$ npm install -g npm-groovy-lint
$ npm-groovy-lint OPTIONS
Parameter | Type | Description |
---|---|---|
-p --path | String | Directory containing the files to lint Example: ./path/to/my/groovy/files |
-f --files | String | Comma-separated list of Ant-style file patterns specifying files that must be included. Default: "**/*.groovy,**/Jenkinsfile" , or "**/*.groovy" if --rulesets Groovy, or **/Jenkinsfile if --rulesets Jenkinsfile Examples: - "**/Jenkinsfile"<br/> - "*/*.groovy" |
-r --rulesets | String | RuleSet file(s) to use for linting. If it is a directory, all rulesets will be used. RuleSet file definition: http://codenarc.sourceforge.net/codenarc-creating-ruleset.html. If not specified, npm-groovy-script default ones will be used depending on file types found in --path: - Groovy recommended rules, also usable with --rulesets Groovy - Jenkinsfile recommended rules, also usable with --rulesets Jenkinsfile Examples: - "./config/codenarc/RuleSet-Custom.groovy" - "./path/to/my/ruleset/files" - Jenkinsfile |
-o --output | String | Output format (txt,json,html,xml), or path to a file with one of these extensions Default: txt Examples: - "txt" - "json" - "./logs/myLintResults.txt" - "./logs/myLintResults.json" - "./logs/myLintResults.html" - "./logs/myLintResults.xml" |
-v --verbose | Boolean | More outputs in console, including performed fixes |
--fix | Boolean | Automatically fix problems when possible See Autofixable rules |
-i --ignore-pattern | String | Comma-separated list of Ant-style file patterns specifying files that must be ignored Default: none Example: "**/test/*"" |
--failonerror | Boolean | Fails if at least one error is found |
--failonwarning | Boolean | Fails if at least one warning is found |
--failoninfo | Boolean | Fails if at least one error is found |
--codenarcargs | Boolean | Use core CodeNarc arguments (all npm-groovy-lint arguments will be ignored) Doc: http://codenarc.sourceforge.net/codenarc-command-line.html Example: npm-groovy-lint --codenarcargs -basedir="jdeploy-bundle/lib/example" -rulesetfiles="file:jdeploy-bundle/lib/example/RuleSet-Groovy.groovy" -maxPriority1Violations=0 -report="xml:ReportTestCodenarc.xml |
-h --help | Boolean | Show help (npm-groovy-lint -h OPTIONNAME to see option detail with examples) |
npm-groovy-lint --rulesets Jenkinsfile
npm-groovy-lint --rulesets Groovy
npm-groovy-lint --rulesets Jenkinsfile --fix
npm-groovy-lint --rulesets Groovy --output json
npm-groovy-lint --codenarcargs -basedir="jdeploy-bundle/lib/example" -rulesetfiles="file:jdeploy-bundle/lib/example/RuleSet-Groovy.groovy" -title="TestTitleCodenarc" -maxPriority1Violations=0' -report="html:ReportTestCodenarc.html"
Contribute to add more rules fixes :)
Contributions are very welcome !
npm run lint
then npm run test
to check your updates didn't break anythingThis package uses :
FAQs
Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files
The npm package npm-groovy-lint receives a total of 8,452 weekly downloads. As such, npm-groovy-lint popularity was classified as popular.
We found that npm-groovy-lint demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.