Skip to content
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

Spelling check pre-commit hook in all documents and .py files #168

Closed
bobleesj opened this issue Oct 27, 2024 · 2 comments · Fixed by #169
Closed

Spelling check pre-commit hook in all documents and .py files #168

bobleesj opened this issue Oct 27, 2024 · 2 comments · Fixed by #169

Comments

@bobleesj
Copy link
Contributor

One of the release checklists is to ensure typos, would you like to have a pre-commit hook for spelling check? I've used for JOSS submission and it works well:

Usage (Terminal outputs)

isort....................................................................Passed
nbstripout...............................................................Passed
Prevent Commit to Main Branch............................................Passed
codespell................................................................Failed
- hook id: codespell
- exit code: 65


README.md:25: fuctions ==> functions
README.md:82: documention ==> documentation
paper.md:86: minmize ==> minimize
paper.md:97: Initalize ==> Initialize
paper.md:107: Initalize ==> Initialize
paper.bib:106: Indide ==> Inside, Indeed

Reference

Codespell: https://github.com/codespell-project/codespell (1k stars)

Usage in .pre-commit-config.yaml

  - repo: https://github.com/codespell-project/codespell
    rev: v2.2.4
    hooks:
      - id: codespell
        exclude: '\.cif$'
        additional_dependencies:
          - tomli
@bobleesj bobleesj changed the title Spelling check pre-commit hook in all documents Spelling check pre-commit hook in all documents and .py files Oct 27, 2024
@bobleesj
Copy link
Contributor Author

The hook doesn't fix those spelling. It suggests for alternatives - like flake8 errors. We can also ignore certain lines and words based configured for each packages using .txt files

src/coordination/filter.py:45: ther ==> there, their, the, other
``

@sbillinge
Copy link
Collaborator

this sounds like a great idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants