-
Notifications
You must be signed in to change notification settings - Fork 3
/
.pre-commit-config.yaml
86 lines (76 loc) · 2.56 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
ci:
autoupdate_schedule: "monthly"
autoupdate_commit_msg: "chore: update pre-commit hooks"
autofix_prs: false # Comment "pre-commit.ci autofix" on a PR to trigger
default_language_version:
python: "python3.11"
repos:
- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: "v4.6.0"
hooks:
- id: "check-added-large-files"
- id: "check-case-conflict"
- id: "check-executables-have-shebangs"
- id: "check-shebang-scripts-are-executable"
- id: "check-merge-conflict"
- id: "check-symlinks"
- id: "destroyed-symlinks"
- id: "check-vcs-permalinks"
- id: "check-json"
- id: "check-toml"
- id: "check-yaml"
# Without --unsafe, !reset in compose YAML triggers error
args: ["--unsafe"]
- id: "end-of-file-fixer"
- id: "mixed-line-ending"
- id: "trailing-whitespace"
- repo: "https://github.com/astral-sh/ruff-pre-commit"
rev: "v0.6.3"
hooks:
- id: "ruff"
# NOTE: "--exit-non-zero-on-fix" is important for CI to function
# correctly!
args: ["--fix", "--exit-non-zero-on-fix"]
- repo: "https://github.com/psf/black"
rev: "24.8.0"
hooks:
- id: "black"
# Format and validate CFF. NOTE: pre-commit doesn't recognize CFF as YAML
# (https://github.com/pre-commit/identify/pull/435), so we may need to
# specify the prettier hook twice if we want to format other things and avoid
# a messy regex.
- repo: "https://github.com/rbubley/mirrors-prettier"
rev: "v3.3.3"
hooks:
- id: "prettier"
files: "CITATION.cff"
- repo: "https://github.com/citation-file-format/cffconvert"
rev: "054bda51dbe278b3e86f27c890e3f3ac877d616c"
hooks:
- id: "validate-cff"
args:
- "--verbose"
- repo: "https://github.com/codespell-project/codespell"
rev: "v2.3.0"
hooks:
- id: "codespell"
exclude: ".codespellignore"
# TODO: Enable vulture
# - repo: "https://github.com/jendrikseipp/vulture"
# rev: "v2.7"
# hooks:
# - id: "vulture"
# TODO: Enable shellcheck
# # This version requires Docker, which is not available in all CI
# # providers. Works on GitHub actions but not CircleCI.
# - repo: "https://github.com/koalaman/shellcheck-precommit"
# rev: "v0.9.0"
# hooks:
# - id: "shellcheck"
# # args: ["--severity=warning"] # Optionally only show errors and warnings
#
# # This version does not require Docker
# - repo: "https://github.com/shellcheck-py/shellcheck-py"
# rev: "v0.9.0.5"
# hooks:
# - id: "shellcheck"