Skip to content

Use typos for spell checking #4689

Description

@seisman

The project currently uses codespell⁠ to detect spelling mistakes. However, codespell does not detect typos in snake_case, which are very common for parameter or variable names.

For example, for the typo pricipal_axis fixed in #2940:

pricipal_axis
pricipal axis

codespell only reports the typo in the second line, but not the first one.

In contrast, typos, another source code spell checker written in Rust, can detect typos in snake_case identifiers.

For a broader comparison of typos with other spell checkers, see:
https://github.com/crate-ci/typos/blob/master/docs/comparison.md

codespell and typos are designed with different philosophies, so a typo may be detected by one tool but not the other (for example, #4688). There are two possible options:

  1. Replace codespell with typos.
  2. Run typos alongside codespell.

I personally prefer option 2: run both typos and codespell for a few months and then decide whether it makes sense to keep both tools or drop one of them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionsNeed more discussion before taking further actions

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions