Skip to content

pre-commit: Bump codespell and add hook to check commit msg spelling

Add a new optional hook to check spelling of commit messages. Below is an example of use:

(swh) ✔ ~/swh/swh-environment/swh-loader-svn [master ↑·1|⚑ 35] 
16:48 $ pre-commit install -t commit-msg
pre-commit installed at .git/hooks/commit-msg
(swh) ✔ ~/swh/swh-environment/swh-loader-svn [master ↑·1|⚑ 35] 
16:48 $ touch foo
(swh) ✔ ~/swh/swh-environment/swh-loader-svn [master ↑·1|…1⚑ 35] 
16:48 $ git add foo
(swh) ✔ ~/swh/swh-environment/swh-loader-svn [master ↑·1|●1⚑ 35] 
16:48 $ git commit -m "Thi is a mesage with speling issue"
Trim Trailing Whitespace.................................................Passed
Check JSON...........................................(no files to check)Skipped
Check Yaml...........................................(no files to check)Skipped
flake8...............................................(no files to check)Skipped
Check source code spelling...............................................Passed
mypy.................................................(no files to check)Skipped
isort................................................(no files to check)Skipped
black................................................(no files to check)Skipped
Check JSON...........................................(no files to check)Skipped
Check Yaml...........................................(no files to check)Skipped
flake8...............................................(no files to check)Skipped
Check commit message spelling............................................Failed
- hook id: codespell
- exit code: 65

.git/COMMIT_EDITMSG:1: Thi ==> The, this
.git/COMMIT_EDITMSG:1: mesage ==> message
.git/COMMIT_EDITMSG:1: speling ==> spelling

mypy.................................................(no files to check)Skipped
isort................................................(no files to check)Skipped
black................................................(no files to check)Skipped

Migrated from D7138 (view on Phabricator)

Merge request reports