nvuillam / npm-groovy-lint

Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files using command line
https://nvuillam.github.io/npm-groovy-lint/
MIT License
193 stars 61 forks source link

fix: data race on stdout capture #343

Closed stevenh closed 6 months ago

stevenh commented 6 months ago

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

github-actions[bot] commented 6 months ago

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ DOCKERFILE hadolint 1 0 0.3s
✅ GROOVY npm-groovy-lint 9 1 0 18.71s
✅ JAVASCRIPT eslint 100 0 0 5.11s
✅ JSON eslint-plugin-jsonc 9 0 0 2.03s
✅ JSON jsonlint 9 0 0.28s
✅ JSON npm-package-json-lint yes no 0.67s
✅ JSON prettier 9 2 0 1.44s
✅ JSON v8r 9 0 7.51s
✅ MARKDOWN markdownlint 7 2 0 4.13s
✅ MARKDOWN markdown-link-check 7 0 1.06s
✅ MARKDOWN markdown-table-formatter 7 2 0 0.64s
✅ REPOSITORY checkov yes no 13.99s
✅ REPOSITORY gitleaks yes no 6.18s
✅ REPOSITORY git_diff yes no 0.12s
✅ REPOSITORY grype yes no 13.67s
✅ REPOSITORY secretlint yes no 2.07s
✅ REPOSITORY trivy-sbom yes no 1.67s
✅ REPOSITORY trufflehog yes no 9.19s
✅ SPELL cspell 131 0 9.92s
✅ SPELL lychee 19 0 4.84s
✅ XML xmllint 1 0 0 0.11s
✅ YAML prettier 3 0 0 0.51s
✅ YAML v8r 3 0 9.69s
✅ YAML yamllint 3 0 0.44s

See detailed report in MegaLinter reports

_MegaLinter is graciously provided by OX Security_

stevenh commented 6 months ago

While this fixes the issues, I'm going to see if we can use a CodeNarc plugin to create a custom output writer that doesn't require locking as this will limit concurrency, which is not ideal.

stevenh commented 6 months ago

@nvuillam ready for review, it true fashion bigger than expected and should be split up but working as a whole, so...

nvuillam commented 6 months ago

@stevenh released in https://github.com/nvuillam/npm-groovy-lint/releases/tag/v14.0.0 :)