Skip to content

[MNT]: Add codespell to pre-commit hooks #22740

Closed
@matthewfeickert

Description

@matthewfeickert

Summary

In PR #22733 @QuLogic caught a spelling error of mine (which is great!) but there will inevitably be typos that slip through if only humans are checking. https://github.com/codespell-project/codespell is a really nice way to check for typos and it has a nice pre-commit hook. As Matplotlib already uses pre-commit 🚀 (thanks to @ianhi in PR #21583) this would be an easy add. 👍

Proposed fix

Add the following hook (maybe some variations) to .pre-commit-config.yaml

  - repo: https://github.com/codespell-project/codespell
    rev: v2.1.0
    hooks:
      - id: codespell
        files: ^.*\.(py|c|h|md|rst|yml)$
        args: ["--write-changes", "--ignore-words-list", "hist,nd"]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions