Skip to content

Commit

Permalink
fix: files not linting
Browse files Browse the repository at this point in the history
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.

Fix command line -ext extensions not being processed correctly and
matching too many files as it was missing the prefix.

Also:
* Fix README.md typo
* Run dev:pre-commit to update CHANGELOG.md
* Add more cspell entries
  • Loading branch information
stevenh committed Nov 7, 2023
1 parent 6d7806b commit 1dfb0f9
Show file tree
Hide file tree
Showing 8 changed files with 152 additions and 54 deletions.
75 changes: 72 additions & 3 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,47 +82,68 @@
"WORKDIR",
"Whitespaces",
"aestasit",
"Affero",
"agorapulse",
"analyse",
"anymatch",
"appender",
"Appender",
"archy",
"argparse",
"arity",
"arrayish",
"atlassian",
"Autofixable",
"autofixing",
"beakerx",
"behaviour",
"Behl",
"Behlül",
"blablabla",
"Blablabla",
"btime",
"callsites",
"camelcase",
"cdci",
"chardet",
"Charsets",
"chownr",
"circleci",
"CLASSNAME",
"CLASSPATH",
"clientid",
"cliui",
"Cloneable",
"Codacy",
"codecov",
"codehaus",
"codenarc",
"Codenarc",
"CODENARC",
"codenarcargs",
"Commandline",
"commondir",
"COPYPASTE",
"Creds",
"cvfm",
"decamelize",
"dfsg",
"Dlogging",
"docwhat",
"Dorg",
"dotenv",
"doublons",
"ecnfo",
"ECONNREFUSED",
"entrypoint",
"ENTRYPOINT",
"eslintcache",
"espree",
"esquery",
"esrecurse",
"estraverse",
"esutils",
"ETIMEOUT",
"excptn",
"extglob",
"failon",
Expand All @@ -131,14 +152,19 @@
"failonwarning",
"favicon",
"filechooser",
"FILEIO",
"fileoverview",
"fileset",
"finalise",
"Finalizers",
"fixrules",
"Fixrules",
"flattendeep",
"fontawesome",
"Fresources",
"fromentries",
"fsevents",
"Ftest",
"fullwidth",
"gaelyk",
"gaiden",
Expand All @@ -148,6 +174,7 @@
"getownpropertydescriptors",
"gitattributes",
"gmetrics",
"Gorm",
"gpars",
"gperfutils",
"gprof",
Expand All @@ -165,21 +192,30 @@
"grooylintrc",
"hadolint",
"hasha",
"Hashtable",
"hostedtoolcache",
"httpbuilder",
"httpserver",
"ignorepattern",
"imurmurhash",
"Inet",
"ìnfo",
"infrastructor",
"Instanceof",
"Intall",
"isarray",
"isexe",
"Javadoc",
"javaexecutable",
"javaoptions",
"javascripts",
"javax",
"jdbc",
"Jdbc",
"jdeploy",
"jenkinsfile",
"Jenkinsfile",
"Jenkinsfiles",
"jenkinsjobdsl",
"jenkinspipeline",
"jenkinssharedlib",
Expand All @@ -194,6 +230,7 @@
"katalon",
"killserver",
"kisswebframework",
"Kopka",
"lcov",
"lelama",
"lelamanul",
Expand All @@ -202,16 +239,23 @@
"lintagainafterfix",
"logback",
"loglevel",
"Loopback",
"markdownlint",
"materialx",
"megalinter",
"Metadatas",
"Microbundle",
"micronaut",
"microservice",
"minipass",
"minizlib",
"Misordered",
"mkdocs",
"modelcatalogue",
"mygroovyfile",
"MYOTHERVAR",
"MYVAR",
"NEWLINECLOSINGBRACE",
"nextflow",
"njre",
"nolintafter",
Expand All @@ -220,13 +264,18 @@
"notif",
"notkept",
"nuxt",
"Nuxt",
"nvuillam",
"Objs",
"occurrences",
"openjdk",
"optionator",
"OPTIONNAME",
"optns",
"orgs",
"overridden",
"PARAMNAME",
"Pawel",
"pawelkopka",
"pckg",
"pdxc",
Expand All @@ -235,27 +284,39 @@
"pids",
"pify",
"preload",
"Println",
"processinfo",
"promisified",
"PROSELINT",
"pymdownx",
"ratpack",
"readdirp",
"regexpp",
"restassured",
"returnrules",
"ruleset",
"Ruleset",
"rulesetfiles",
"rulesets",
"Rulesets",
"rulesetsoverridetype",
"sarif",
"Sarif",
"SARIF",
"SEMGREP",
"Serv",
"serverhost",
"serverport",
"Servlet",
"setalias",
"sfdx",
"simplelogger",
"Slctn",
"Slurper",
"soapui",
"socio",
"sourcefilepath",
"sourcefiles",
"spdx",
"spreadsheetbuilder",
"springboot",
Expand All @@ -267,17 +328,21 @@
"stehno",
"stevenh",
"stylelint",
"Sublicensing",
"superlite",
"sysgears",
"Tablesort",
"tmptest",
"trimend",
"trimleft",
"trimright",
"trimstart",
"TRIVY",
"tsbuildinfo",
"twemoji",
"twhateverelse",
"typedarray",
"Uçar",
"ufeff",
"uncommented",
"universalify",
Expand All @@ -286,17 +351,21 @@
"updt",
"uuidv",
"uuuurf",
"VARNAME",
"vertx",
"vuepress",
"Vuillamy",
"warhod",
"wesh",
"whateverelse",
"Whitespaces",
"WIPO",
"WORKDIR",
"wrappy",
"wscript",
"yallist",
"yessss",
"zalgo",
"zpars",
"\u00ecnfo"
"zpars"
]
}
}
25 changes: 21 additions & 4 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,27 @@

## UNRELEASED

- Automate release of beta version
- Secure workflows with github environments
- Add label in dockerfile
- Refactor docker build & push github actions workflows
## [12.0.1] 2023-11-06

- Fix: bump openjdk version from 11 to 17 in Docker image by @SerhiiKorolik in https://github.com/nvuillam/npm-groovy-lint/pull/317

## [12.0.0] 2023-11-04

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 https://github.com/nvuillam/npm-groovy-lint/pull/254
* Bump json5 from 2.2.1 to 2.2.3 by @dependabot in https://github.com/nvuillam/npm-groovy-lint/pull/260
* ci: fix action failures by @stevenh in https://github.com/nvuillam/npm-groovy-lint/pull/309
* chore: update node to 18 lts by @stevenh in https://github.com/nvuillam/npm-groovy-lint/pull/310
* feat: improve the vscode deployment by @stevenh in https://github.com/nvuillam/npm-groovy-lint/pull/307
* Improve publish via CI + beta when in main by @nvuillam in https://github.com/nvuillam/npm-groovy-lint/pull/311
* chore: improve flow debugging by @stevenh in https://github.com/nvuillam/npm-groovy-lint/pull/303
* ci: predictable server builds and port option by @stevenh in https://github.com/nvuillam/npm-groovy-lint/pull/312
* fix: status bar message by @stevenh in https://github.com/nvuillam/npm-groovy-lint/pull/302
* fix: server and test stability by @stevenh in https://github.com/nvuillam/npm-groovy-lint/pull/313
* fix: UnnecessaryGString for strings with slashes by @stevenh in https://github.com/nvuillam/npm-groovy-lint/pull/304

## [11.1.1] 2022-10-31

Expand Down
14 changes: 7 additions & 7 deletions groovy/src/main/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Manifest-Version: 1.0
Class-Path: CodeNarc-3.1.0.jar GMetrics-2.1.0.jar groovy/lib/ant-1.10.
11.jar groovy/lib/ant-launcher-1.10.11.jar groovy/lib/commons-cli-1.4
.jar groovy/lib/groovy-3.0.9.jar groovy/lib/groovy-ant-3.0.9.jar groo
vy/lib/groovy-cli-commons-3.0.9.jar groovy/lib/groovy-dateutil-3.0.9.
jar groovy/lib/groovy-json-3.0.9.jar groovy/lib/groovy-templates-3.0.
9.jar groovy/lib/groovy-xml-3.0.9.jar logback-classic-1.4.9.jar logba
ck-core-1.4.9.jar slf4j-api-2.0.9.jar
Class-Path: CodeNarc-3.3.0-pre.jar GMetrics-2.1.0.jar groovy/lib/ant-1
.10.11.jar groovy/lib/ant-launcher-1.10.11.jar groovy/lib/commons-cli
-1.4.jar groovy/lib/groovy-3.0.9.jar groovy/lib/groovy-ant-3.0.9.jar
groovy/lib/groovy-cli-commons-3.0.9.jar groovy/lib/groovy-dateutil-3.
0.9.jar groovy/lib/groovy-json-3.0.9.jar groovy/lib/groovy-templates-
3.0.9.jar groovy/lib/groovy-xml-3.0.9.jar logback-classic-1.4.9.jar l
ogback-core-1.4.9.jar slf4j-api-2.0.9.jar
Created-By: 1.8.0_144 (Oracle Corporation)
Main-Class: com.nvuillam.CodeNarcServer
10 changes: 7 additions & 3 deletions groovy/src/main/com/nvuillam/CodeNarcServer.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ class CodeNarcServer {
respObj.errorDtl = t.getStackTrace().join('\n')
respObj.exceptionType = t.getClass().getName()
respObj.statusCode = 500
logger.debug('Request failed {}', respObj.errorMessage)
logger.debug('Request failed {}', t)
}

// Build response
Expand Down Expand Up @@ -377,7 +377,11 @@ class CodeNarcServer {
}
else if (bodyObj.codeNarcBaseDir) {
// Ant style pattern is used: list all files
LOGGER.debug('Ant file scanner in {}, includes {}, excludes {}', bodyObj.codeNarcBaseDir, bodyObj.codeNarcIncludes, bodyObj.codeNarcExcludes ?: 'none')
LOGGER.debug('Ant file scanner in {}, includes {}, excludes {}',
bodyObj.codeNarcBaseDir,
bodyObj.codeNarcIncludes,
bodyObj.codeNarcExcludes ?: 'none'
)
def ant = new groovy.ant.AntBuilder()
def scanner = ant.fileScanner {
fileset(dir: bodyObj.codeNarcBaseDir) {
Expand Down Expand Up @@ -412,7 +416,7 @@ class CodeNarcServer {
return parseErrors
}

// Try to parse file to get compilation errors
// Try to parse file to get compilation errors
private List<Error> parseFile(File file) {
List<Error> parseErrors = []
try {
Expand Down
2 changes: 1 addition & 1 deletion groovy/src/main/com/nvuillam/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ usage: groovy CodeNarcServer.groovy [--help] [--server] [--port <port>]
To see this in action from the root of this repository:

```shell
groovy -jar lib/java/CodeNarcServer.jar --server
java -jar lib/java/CodeNarcServer.jar --server
```

### Environment
Expand Down
Loading

0 comments on commit 1dfb0f9

Please sign in to comment.