Billingegroup / cookiecutter

A cookie-cutter for DiffPy packages.
Other
1 stars 8 forks source link

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

Open bobleesj opened 2 hours ago

bobleesj commented 2 hours ago

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 commented 2 hours ago

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
``