Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
npm-groovy-lint
Advanced tools
Wrapper for excellent groovy linter CodeNarc, using the great jdeploy and Groovy!
npm-groovy-lint allows you to run CodeNarc via command line without any installation issue
Easy to integrate in a CD/CI process (Jenkins Pipeline,CircleCI...) to lint your groovy or Jenkinsfile :)
$ npm install -g npm-groovy-lint
For advanced usage, you may need to define RuleSet file(s)
You can use as starters :
$ npm-groovy-lint OPTIONS
Parameter | Description | Example |
---|---|---|
--ngl-output=format | npm-groovy-lint provided output (reformatted from CodeNarc output). Available formats: - text (default) - json | --ngl-output=json --ngl-output=text |
Parameter | Description | Example |
---|---|---|
-basedir=DIR | The base (root) directory for the source code to be analyzed. Defaults to the current directory ("."). | -basedir=src/main/groovy |
-includes=PATTERNS | The comma-separated list of Ant-style file patterns specifying files that must be included. Defaults to "**/*.groovy". | -includes=**/*.gr |
-excludes=PATTERNS | The comma-separated list of Ant-style file patterns specifying files that must be excluded. No files are excluded when omitted. | -excludes=/templates/, **/Test. |
-rulesetfiles=FILENAMES | The path to the Groovy or XML RuleSet definition files. This can be a single file path, or multiple paths separated by commas. By default, the paths specified are relative to the classpath. But these paths may be optionally prefixed by any of the valid java.net.URL prefixes, such as "file:" (to load from a relative or absolute path on the filesystem), or "http:". If it is a URL, its path may be optionally URL-encoded. That can be useful if the path contains any problematic characters, such as comma (',') or hash ('#'). For instance: "file:src/test/resources/RuleSet-,#.txt" can be encoded as: "file:src%2Ftest%2Fresources%2FRuleSet-%2C%23.txt" See URLEncoder#encode(java.lang.String, java.lang.String). Defaults to "rulesets/basic.xml". | -rulesetfiles=rulesets/imports.xml, rulesets/naming.xml |
-report=REPORT-TYPE[:FILENAME] | The definition of the report to produce. The option value is of the form TYPE[:FILENAME], where TYPE is one of the predefined type names: "html", "xml", "text", "console" or else the fully-qualified class name of a class (accessible on the classpath) that implements the org.codenarc.report.ReportWriter interface. And FILENAME is the filename (with optional path) of the output report filename. If the report filename is omitted, the default filename for the report type is used ("CodeNarcReport.html" for "html" and "CodeNarcXmlReport.xml" for "xml"). If no report option is specified, default to a single "html" report with the default filename. | -report=html -report=html:MyProject.html -report=xml -report=xml:MyXmlReport.xml -report=org.codenarc.report. HtmlReportWriter |
-maxPriority1Violations=MAX | The maximum number of priority 1 violations allowed (int). | -maxPriority1Violations=0 |
-maxPriority2Violations=MAX | The maximum number of priority 2 violations allowed (int). | -maxPriority2Violations=0 |
-maxPriority3Violations=MAX | The maximum number of priority 3 violations allowed (int). | -maxPriority3Violations=0 |
-title=REPORT TITLE | The title for this analysis; used in the output report(s), if supported by the report type(s). Optional. | -title="My Project" |
-help | Display the command-line help. If present, this must be the only command-line parameter. | -help |
See OPTIONS in CodeNarc documentation
// npm-groovy-lint output
$ npm-groovy-lint -report="xml:MyGroovyLinterReport.xml" --ngl-output=text
// npm-groovy-lint output
$ npm-groovy-lint -includes=**/Jenkinsfile -rulesetfiles="file:config/codenarc/RuleSet-Base.groovy" --ngl-output=json
// CodeNarc output
$ npm-groovy-lint -includes=**/Jenkinsfile -rulesetfiles="file:config/codenarc/RuleSet-All.groovy" -title="MyJenkinsfileLinterReport" -maxPriority1Violations=0 -report="html:MyJenkinsfileLinterReport.html"
// CodeNarc output
$ npm-groovy-lint -basedir="src" -rulesetfiles="file:config/codenarc/RuleSet-Base.groovy" -title="MyGroovyLinterReport" -maxPriority1Violations=0 -report="html:MyGroovyLinterReport.html"
Contributions are very welcome !
npm run lint
then npm run test
to check your updatesThis package is just a bundle with a little script, it relies on :
FAQs
Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files
The npm package npm-groovy-lint receives a total of 7,912 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.