-
-
Notifications
You must be signed in to change notification settings - Fork 281
feat(linter): add codespell linter #6256
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
base: main
Are you sure you want to change the base?
Conversation
7acabdc to
3f7cc67
Compare
3f7cc67 to
475b23f
Compare
|
This pull request has been automatically marked as stale because it has not had recent activity. If you think this pull request should stay open, please remove the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| @@ -0,0 +1,2 @@ | |||
| abandonded Dockefile | |||
| abberivated acadamy | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Autofix Test File: Misspellings Remain Unfixed
The spell_fix_1.md test file contains the same misspellings as spell_bad_1.md, but should contain the corrected version. Since codespell has cli_lint_fix_arg_name: --write-changes defined, autofix tests expect this file to show the corrected output after applying fixes. It should contain "abandoned Dockerfile\nabbreviated academy" to match the corrections in spell_good_1.md.
|
Can the conflicts be solved? |
Add the codespell linter which uses a dictionary of common misspellings and ignores unknown words. Signed-off-by: Roger Luethi <[email protected]>
475b23f to
d16a1ac
Compare
| - .jsonc | ||
| - .json5 | ||
| - .yaml | ||
| - .yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Restrictive file extensions prevent checking code
The file_extensions list only includes documentation and data files, preventing codespell from checking source code files (like .py, .js, etc.) as intended by its description and purpose. Consider adding * or a broader list of code extensions to ensure it runs on the codebase.
| config_file_name: .codespellrc | ||
| cli_config_arg_name: --config | ||
| cli_help_arg_name: --help | ||
| cli_lint_ignore_arg_name: --skip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Invalid mapping of ignore file argument
cli_lint_ignore_arg_name is mapped to --skip, which expects a comma-separated list of patterns, but MegaLinter passes the path to the ignore file. This means SPELL_CODESPELL_IGNORE_FILE will not work as expected (it will tell codespell to skip the ignore file itself, not the files listed inside it). Remove this line and rely on .codespellrc for ignores.
Add the codespell linter which uses a dictionary of common misspellings and ignores unknown words.
This is an updated version of #4143 which was closed as stale and could not be reopened by the maintainer.
Fixes #6255
Proposed Changes
Add the codespell linter which uses a dictionary of common misspellings and ignores unknown words.
Readiness Checklist
Author/Contributor
Reviewing Maintainer
breakingif this is a large fundamental changeautomation,bug,documentation,enhancement,infrastructure, orperformanceNote
Integrates the codespell linter across MegaLinter (descriptor, flavors, Docker images, schemas), with tests, docs, and generated metadata updates.
SPELL_CODESPELL(codespell) descriptor with config, examples, and installer inspell.megalinter-descriptor.yml.linters/spell_codespell/Dockerfile.codespell==2.4.1and add/venvs/codespell/bintoPATHacross rootDockerfileand all flavors (c_cpp,cupcake,documentation,dotnet,dotnetweb,go,java,javascript,php,python,ruby,rust,salesforce,swift,terraform).spell_codespellin.automation/generated/linters_matrix.jsonand versions in.automation/generated/linter-versions.json..automation/generated/linter-links-previews.jsonand.automation/generated/linter-helps.json.SPELL_CODESPELLto flavors (flavor.json),megalinter/descriptors/all_flavors.json, and JSON Schemas.SPELL_CODESPELLin.mega-linter.yml..cspell.jsondictionary withcodespellterms.docs/standalone-linters.md.CHANGELOG.md.spell_codespell_test.pyand sample files under.automation/test/spell_codespell/.Written by Cursor Bugbot for commit d16a1ac. This will update automatically on new commits. Configure here.