Skip to content

Commit 395b1c3

Browse files
committed
Add pre-commit configuration file
This was adapted from PlasmaPy's .pre-commit-config.yaml
1 parent f7fd00e commit 395b1c3

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

.pre-commit-config.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
ci:
2+
autofix_prs: false
3+
autoupdate_schedule: monthly
4+
5+
repos:
6+
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v5.0.0
9+
hooks:
10+
- id: check-ast
11+
name: validate Python code
12+
- id: check-merge-conflict
13+
name: check for git merge conflicts
14+
exclude: .*\.rst
15+
- id: check-case-conflict
16+
name: check for filename case conflicts
17+
- id: name-tests-test
18+
args: [--pytest-test-first]
19+
- id: trailing-whitespace
20+
- id: end-of-file-fixer
21+
- id: check-json
22+
- id: check-toml
23+
- id: check-yaml
24+
25+
- repo: https://github.com/sirosen/texthooks
26+
rev: 0.6.8
27+
hooks:
28+
- id: fix-smartquotes
29+
- id: fix-spaces
30+
- id: fix-ligatures
31+
- id: forbid-bidi-controls
32+
33+
- repo: https://github.com/python-jsonschema/check-jsonschema
34+
rev: 0.31.2
35+
hooks:
36+
- id: check-github-workflows
37+
38+
- repo: https://github.com/crate-ci/typos
39+
rev: v1.30.0
40+
hooks:
41+
- id: typos
42+
43+
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
44+
rev: v2.14.0
45+
hooks:
46+
- id: pretty-format-ini
47+
args: [--autofix]
48+
- id: pretty-format-yaml
49+
args: [--autofix]
50+
# For the labeler GitHub Action, labels with spaces in them must
51+
# be put in quotes. However, the pretty-format-yaml hook will
52+
# remove the quotes which will break that action, so we should not
53+
# run this hook on `labeler.yml` (or certain other files).
54+
exclude: .github/labeler.yml|.pre-commit-search-and-replace.yaml
55+
56+
- repo: https://github.com/pre-commit/pygrep-hooks
57+
rev: v1.10.0
58+
hooks:
59+
- id: python-check-blanket-noqa
60+
name: noqa comments have an error code
61+
exclude: ^docs/plasmapy_sphinx/
62+
- id: rst-directive-colons
63+
- id: rst-inline-touching-normal
64+
- id: text-unicode-replacement-char

0 commit comments

Comments
 (0)