Skip to content

Commit edfbdb0

Browse files
authored
Add typos tool to pre-commit (#674)
This tool corrects common misspellings in all kinds of text files.
1 parent 52e88f9 commit edfbdb0

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ repos:
1616
- id: check-toml
1717
- id: end-of-file-fixer
1818
- id: trailing-whitespace
19+
- repo: https://github.com/crate-ci/typos
20+
rev: 6cb49915af2e93e61f5f0d0a82216e28ad5c7c18 # frozen: v1
21+
hooks:
22+
- id: typos
23+
exclude: |
24+
(?x)^(
25+
.*\.min\.css
26+
|.*\.min\.js
27+
|.*\.css\.map
28+
|.*\.js\.map
29+
|.*\.svg
30+
)$
1931
- repo: https://github.com/tox-dev/pyproject-fmt
2032
rev: 57b6ff7bf72affdd12c7f3fd6de761ba18a33b3a # frozen: v2.5.1
2133
hooks:

.typos.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Configuration file for 'typos' tool
2+
# https://github.com/crate-ci/typos
3+
4+
[default]
5+
extend-ignore-re = [
6+
# Single line ignore comments
7+
"(?Rm)^.*(#|//)\\s*typos: ignore$",
8+
# Multi-line ignore comments
9+
"(?s)(#|//)\\s*typos: off.*?\\n\\s*(#|//)\\s*typos: on"
10+
]

CHANGELOG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ Changelog
203203
1.2.2 (2017-11-03)
204204
------------------
205205

206-
* Fix collection to not sometimes crash when encoutering pytest ``Item``\s
206+
* Fix collection to not sometimes crash when encountering pytest ``Item``\s
207207
without a module.
208208

209209
1.2.1 (2017-06-17)

0 commit comments

Comments
 (0)