Skip to content

Conversation

@ideaship
Copy link
Contributor

@ideaship ideaship commented Sep 29, 2025

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

  • Add entry to the CHANGELOG listing the change and linking to the corresponding issue (if appropriate)
  • If documentation is needed for this change, has that been included in this pull request

Reviewing Maintainer

  • Label as breaking if this is a large fundamental change
  • Label as either automation, bug, documentation, enhancement, infrastructure, or performance

Note

Introduces the codespell linter across MegaLinter (descriptors, schemas, matrices, flavors, Docker builds) with docs, tests, and version/link updates.

  • New linter: SPELL_CODESPELL (codespell)
    • Add descriptor in megalinter/descriptors/spell.megalinter-descriptor.yml with config, examples, and install.
    • Update schemas (megalinter-configuration.jsonschema.json, megalinter-custom-flavor.jsonschema.json) and flavors lists (all_flavors.json, per-flavor flavor.json).
    • Wire into linter matrix (.automation/generated/linters_matrix.json) and versions/links (linter-versions.json, linter-links-previews.json).
    • Add standalone linter image: linters/spell_codespell/Dockerfile; list in docs docs/standalone-linters.md.
    • Install in main and flavor Dockerfiles (add PIP_CODESPELL_VERSION, venv, PATH entries).
    • Tests and fixtures: megalinter/tests/.../spell_codespell_test.py and .automation/test/spell_codespell/*.
    • Config/metadata: .mega-linter.yml (disable errors), .cspell.json additions, changelog entry.

Written by Cursor Bugbot for commit 16b8171. This will update automatically on new commits. Configure here.

cursor[bot]

This comment was marked as outdated.

@github-actions
Copy link
Contributor

This pull request has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this pull request should stay open, please remove the O: stale 🤖 label or comment on the pull request.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Oct 31, 2025
@github-actions github-actions bot closed this Nov 14, 2025
@nvuillam nvuillam reopened this Nov 14, 2025
@nvuillam nvuillam removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Nov 14, 2025
Copy link

@cursor cursor bot left a 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
Copy link

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.

Fix in Cursor Fix in Web

@echoix
Copy link
Collaborator

echoix commented Nov 17, 2025

Can the conflicts be solved?

- .jsonc
- .json5
- .yaml
- .yml
Copy link

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.

Fix in Cursor Fix in Web

Add the codespell linter which uses a dictionary of common misspellings
and ignores unknown words.

Signed-off-by: Roger Luethi <roger.luethi@bisdn.de>
# renovate: datasource=pypi depName=codespell
ARG PIP_CODESPELL_VERSION=2.4.1
pip:
- codespell==${PIP_CODESPELL_VERSION}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Missing lint_all_other_linters_files property for codespell

The codespell linter definition is missing the lint_all_other_linters_files property. Since the SPELL descriptor sets lint_all_other_linters_files: true at the descriptor level, codespell will inherit this value and lint all files from all other linters instead of only the specified file extensions. All other spell linters in this descriptor (proselint, vale, and lychee) explicitly set lint_all_other_linters_files: false to override the descriptor-level setting. This causes codespell to operate on an unexpectedly large set of files beyond its intended scope.

Fix in Cursor Fix in Web

@echoix
Copy link
Collaborator

echoix commented Nov 24, 2025

@nvuillam seems ready

Copy link
Member

@nvuillam nvuillam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good for me, thanks @ideaship for the PR :)

@nvuillam nvuillam merged commit f9f8986 into oxsecurity:main Nov 30, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add new linter: codespell

3 participants