-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
101 lines (88 loc) · 3.61 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# This file contains all the hooks that precommend would ever recommend to users.
# They are kept in this file in order to allow pre-commit CI to update them on a
# regular basis. If you want to add a new hook, add it here and then add a corresponding
# inclusion rule in rules.py. Note that YAML parsing with comment preservation is
# a fickle issue: Only end-of-line comments are safe to use with our toolchain.
repos:
- repo: local
hooks:
- id: synchronize-files
name: Synchronize files within the repository
entry: python sync.py
language: python
always_run: true
pass_filenames: false
- id: bump-precommit-and-identify
name: Bump versions of pre-commit and identify
entry: python bump_identify.py
language: python
additional_dependencies: [requests]
always_run: true
pass_filenames: false
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black # Run Black - the uncompromising Python code formatter
- id: black-jupyter # Run Black - the uncompromising Python code formatter (Jupyter version)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: end-of-file-fixer # Ensure existence of newline characters at file ends
- id: check-yaml # Make sure that contained YAML files are well-formed
- id: trailing-whitespace # Trim trailing whitespace of all sorts
- id: check-added-large-files # Apply a file size limit of 500kB
- id: check-toml # Simple parser validation of e.g. pyproject.toml
- id: requirements-txt-fixer # Sort lines in requirements files
- id: check-json # Check validity of JSON files
- id: pretty-format-json # Format JSON files consistently
exclude_types:
- jupyter
args:
- --autofix
- id: mixed-line-ending # Ensure consistent line endings
- repo: https://github.com/rhysd/actionlint
rev: v1.7.3
hooks:
- id: actionlint # GitHub Actions Workflow linter
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
- id: nbstripout # Make sure that Jupyter notebooks under version control have their outputs stripped before committing
files: ".ipynb"
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format # Apply formatting to CMake files
additional_dependencies:
- pyyaml
- id: cmake-lint # Apply linting to CMake files
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.2
hooks:
- id: clang-format # Format C++ code with Clang-Format - automatically applying the changes
types_or: [c++, c, c#, cuda, objective-c]
args:
- --style=Mozilla
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.7.0
hooks:
- id: setup-cfg-fmt # Automatically format/sanitize setup.cfg
- repo: https://github.com/citation-file-format/cffconvert
rev: main
hooks:
- id: validate-cff # Validate CFF format
- repo: https://github.com/pecigonzalo/pre-commit-shfmt
rev: v2.2.0
hooks:
- id: shell-fmt-go # Format Bash scripts
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.22
hooks:
- id: validate-pyproject # Validate the contents of pyproject.toml
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.4
hooks:
- id: check-readthedocs # Validate the given .readthedocs.yml file
- id: check-dependabot # Validate the given dependabot.yml file
ci:
skip: [bump-precommit-and-identify]