-
-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass extra args for friendlier CSpell UX (#2271) #2275
Conversation
🦙 MegaLinter status:
|
Descriptor | Linter | Files | Fixed | Errors | Elapsed time |
---|---|---|---|---|---|
✅ BASH | bash-exec | 7 | 0 | 0.02s | |
✅ BASH | shellcheck | 7 | 0 | 0.5s | |
✅ BASH | shfmt | 7 | 0 | 0 | 0.39s |
✅ COPYPASTE | jscpd | yes | no | 3.18s | |
✅ DOCKERFILE | hadolint | 105 | 0 | 10.61s | |
✅ JSON | eslint-plugin-jsonc | 21 | 0 | 0 | 2.45s |
✅ JSON | jsonlint | 19 | 0 | 0.26s | |
✅ JSON | v8r | 21 | 0 | 14.6s | |
markdownlint | 305 | 0 | 229 | 7.73s | |
✅ MARKDOWN | markdown-link-check | 305 | 0 | 6.54s | |
✅ MARKDOWN | markdown-table-formatter | 305 | 0 | 0 | 21.93s |
✅ OPENAPI | spectral | 1 | 0 | 1.09s | |
bandit | 176 | 45 | 2.72s | ||
✅ PYTHON | black | 176 | 0 | 0 | 5.96s |
✅ PYTHON | flake8 | 176 | 0 | 2.16s | |
✅ PYTHON | isort | 176 | 0 | 0 | 0.84s |
✅ PYTHON | mypy | 176 | 0 | 8.04s | |
✅ PYTHON | pylint | 176 | 0 | 14.21s | |
pyright | 176 | 282 | 21.23s | ||
✅ REPOSITORY | checkov | yes | no | 31.63s | |
✅ REPOSITORY | git_diff | yes | no | 0.39s | |
✅ REPOSITORY | secretlint | yes | no | 9.47s | |
✅ REPOSITORY | trivy | yes | no | 28.91s | |
✅ SPELL | cspell | 726 | 0 | 23.2s | |
✅ SPELL | misspell | 547 | 0 | 0 | 1.05s |
✅ XML | xmllint | 3 | 0 | 0 | 0.38s |
✅ YAML | prettier | 81 | 0 | 0 | 3.39s |
✅ YAML | v8r | 23 | 0 | 65.56s | |
✅ YAML | yamllint | 82 | 0 | 1.76s |
See detailed report in MegaLinter reports
d42e0fb
to
2234ac4
Compare
Pass --show-context to show the text surrounding a misspelling, --show-suggestions to show best guesses of the correct spelling, and --no-must-find-files to suppress errors when there are no files to spell check. This prevents CSpell from complaining when MegaLinter is run incrementally but no spell-checked files were modified.
1aebdb0
to
aba7ccc
Compare
🦙 MegaLinter status:
|
Descriptor | Linter | Files | Fixed | Errors | Elapsed time |
---|---|---|---|---|---|
✅ BASH | bash-exec | 7 | 0 | 0.02s | |
✅ BASH | shellcheck | 7 | 0 | 0.38s | |
✅ BASH | shfmt | 7 | 0 | 0 | 0.03s |
✅ COPYPASTE | jscpd | yes | no | 2.14s | |
✅ DOCKERFILE | hadolint | 105 | 0 | 7.66s | |
✅ JSON | eslint-plugin-jsonc | 21 | 0 | 0 | 1.73s |
✅ JSON | jsonlint | 19 | 0 | 0.2s | |
✅ JSON | npm-package-json-lint | yes | no | 0.51s | |
✅ JSON | v8r | 21 | 0 | 14.7s | |
markdownlint | 305 | 2 | 229 | 5.99s | |
✅ MARKDOWN | markdown-link-check | 305 | 0 | 5.16s | |
✅ MARKDOWN | markdown-table-formatter | 305 | 2 | 0 | 13.89s |
✅ OPENAPI | spectral | 1 | 0 | 0.78s | |
bandit | 176 | 45 | 3.34s | ||
✅ PYTHON | black | 176 | 0 | 0 | 3.67s |
✅ PYTHON | flake8 | 176 | 0 | 3.57s | |
✅ PYTHON | isort | 176 | 0 | 0 | 0.41s |
✅ PYTHON | mypy | 176 | 0 | 7.01s | |
✅ PYTHON | pylint | 176 | 0 | 11.35s | |
pyright | 176 | 280 | 17.13s | ||
✅ REPOSITORY | checkov | yes | no | 26.25s | |
devskim | yes | 61 | 1.34s | ||
✅ REPOSITORY | dustilock | yes | no | 1.8s | |
✅ REPOSITORY | git_diff | yes | no | 0.04s | |
✅ REPOSITORY | secretlint | yes | no | 4.25s | |
✅ REPOSITORY | syft | yes | no | 3.26s | |
✅ REPOSITORY | trivy | yes | no | 18.73s | |
✅ SPELL | cspell | 726 | 0 | 17.85s | |
✅ SPELL | misspell | 547 | 2 | 0 | 0.46s |
✅ XML | xmllint | 3 | 0 | 0 | 0.03s |
✅ YAML | prettier | 81 | 0 | 0 | 2.37s |
✅ YAML | v8r | 23 | 0 | 52.33s | |
✅ YAML | yamllint | 82 | 0 | 1.44s |
See detailed report in MegaLinter reports
You could have same capabilities but better runtime performances if you request a new MegaLinter flavor.
@Kurt-von-Laven just in case, will the new output still be compliant with custom behaviour of CSpell linter ? ( especially the part that generates an updated .cspell.json file in reports) https://github.com/oxsecurity/megalinter/blob/main/megalinter/linters/CSpellLinter.py |
Great question. Yes, I tested that it still works by running CSpell via npx with and without the new flags and copying the output into https://regex101.com. It's possible to break that regular expression even before this PR by deliberately crafting malicious filenames, but it's very unlikely that it would occur by accident. It doesn't seem necessary to make the regular expression fancier unless we receive user feedback demonstrating a real-world issue since the added complexity would likely make the regex more brittle to changes in CSpell's output format. |
Ok, we'll check that with beta version on MegaLinter own repo before releasing next version :) |
Fixes #2271.
Pass
--show-context
to show the text surrounding a misspelling,--show-suggestions
to show best guesses of the correct spelling, and--no-must-find-files
to suppress errors when there are no files to spell check. This prevents CSpell from complaining when MegaLinter is run incrementally but no spell-checked files were modified.Proposed Changes
--show-context
,--show-suggestions
, and--no-must-find-files
tocli_lint_extra_args
.Readiness Checklist
Author/Contributor
Reviewing Maintainer
breaking
if this is a large fundamental changeautomation
,bug
,documentation
,enhancement
,infrastructure
, orperformance