Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

npm-groovy-lint

Package Overview
Dependencies
Maintainers
1
Versions
204
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-groovy-lint - npm Package Compare versions

Comparing version 4.5.0 to 4.5.1

5

CHANGELOG.md
# Changelog
## [4.5.1] 2020-04-28
- Fixes
- Take in account user overridden indentation space (and other rules) when using --format option [#31](https://github.com/nvuillam/npm-groovy-lint/issues/31)
## [4.5.0] 2020-04-24

@@ -4,0 +9,0 @@

16

jdeploy-bundle/config.js

@@ -34,9 +34,10 @@ // Configuration file management

// Load configuration from identified file, or find config file from a start path
async function loadConfig(startPathOrFile, mode = "lint", sourcefilepath, fileNames = []) {
async function loadConfig(startPathOrFile, mode = "lint", sourcefilepath, fileNamesIn = []) {
let fileNames = [...fileNamesIn];
// Load config
let configUser = {};
if (configExtensions.includes(startPathOrFile.split(".").pop())) {
if (configExtensions.includes(startPathOrFile.split(".").pop()) && mode !== "format") {
// Sent file name
configUser = await loadConfigFromFile(startPathOrFile);
} else if (startPathOrFile.match(/^[a-zA-Z\d-_]+$/)) {
} else if (startPathOrFile.match(/^[a-zA-Z\d-_]+$/) && mode !== "format") {
// Sent string: file a corresponding file name

@@ -63,2 +64,11 @@ fileNames = configExtensions.map(ext => `.groovylintrc-${startPathOrFile}.${ext}`);

configUser = await manageExtends(configUser);
// If mode = "format", call user defined rules to apply them upon the default formatting rules
if (mode === "format") {
const customUserConfig = await loadConfig(startPathOrFile, "lint", sourcefilepath, fileNamesIn);
for (const ruleKey of Object.keys(customUserConfig)) {
if (configUser[ruleKey]) {
configUser[ruleKey] = customUserConfig[ruleKey];
}
}
}
return configUser;

@@ -65,0 +75,0 @@ }

@@ -11,2 +11,6 @@ {

"IfStatementCouldBeTernary": "off",
"Indentation": {
"spacesPerIndentLevel": 2,
"severity": "info"
},
"InvertedCondition": "off",

@@ -13,0 +17,0 @@ "InvertedIfElse": "off",

@@ -200,3 +200,23 @@ /**

["failonerror", "failonwarning", "failoninfo"],
["codenarcargs", ["failonerror", "failonwarning", "failoninfo", "path", "files", "source", "fix", "fixrules", "config"]],
[
"codenarcargs",
[
"failonerror",
"failonwarning",
"failoninfo",
"path",
"files",
"source",
"format",
"fix",
"fixrules",
"config",
"returnrules",
"killserver",
"nolintafter",
"noserver",
"serverhost",
"serverport"
]
],
["noserver", ["serverhost", "serverport", "killserver"]],

@@ -207,5 +227,4 @@ ["fix", "format"],

["failonerror", "failonwarning", "failoninfo"]
],
["format", "config"]
]
]
});

2

package.json
{
"name": "npm-groovy-lint",
"version": "4.5.0",
"version": "4.5.1",
"description": "NPM CodeNarc wrapper to easily lint Groovy files",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc