forked from rorni/mckit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
139 lines (126 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# To use:
#
# pre-commit run -a
#
# Or:
#
# pre-commit install # (runs every time you commit in git)
#
# To update this file:
#
# pre-commit autoupdate
#
# See:
# https://pre-commit.com/ and
# https://github.com/pre-commit/pre-commit for more information
# https://pre-commit.com/hooks.html for more hooks
default_language_version:
python: python3.13
repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v5.0.0"
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
exclude: notebooks
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
exclude: notebooks # jupytext creates python scripts with shebangs but without permissions
- id: check-symlinks
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
exclude: data|.ipynb$|^\.
- id: name-tests-test
exclude: common.py|help*.*py
args:
- --pytest-test-first
- id: mixed-line-ending
- id: pretty-format-json
args: [--autofix, --no-ensure-ascii, --no-sort-keys]
exclude: data|\.ipynb$
- id: requirements-txt-fixer
- id: trailing-whitespace
exclude: data|\.ipynb$
# Changes tabs to spaces
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: "v1.5.5"
hooks:
- id: remove-tabs
- repo: https://github.com/pre-commit/pre-commit
rev: v4.0.1
hooks:
- id: validate_manifest
# Format doc strings
- repo: https://github.com/DanielNoord/pydocstringformatter
rev: "v0.7.3"
hooks:
- id: pydocstringformatter
exclude: _parser\.py$|_tab\.py|extern
- repo: local
hooks:
# Upgrade Python code
- id: pyupgrade
name: pyupgrade
exclude: \.idea|\.cache|^notebooks|^extern
entry: pyupgrade
args:
- --py310-plus
language: system
types: [ python ]
# # Format Python code
# - id: ruff
# name: ruff-format
# entry: ruff format --force-exclude --config pyproject.toml
# language: system
# types: [ python ]
# exclude: ^notebooks|^extern
#
# # Lint and fix Python code (including import sort)
# - id: ruff
# name: ruff
# entry: ruff check --force-exclude --fix --config pyproject.toml
# language: system
# types: [ python ]
# exclude: ^notebooks|^extern
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.0
hooks:
- id: ruff
exclude: ^notebooks|^extern
- id: ruff-format
exclude: ^notebooks|^extern|ipynb$
# CMake formatting
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: "v0.6.13"
hooks:
- id: cmake-format
additional_dependencies: [ pyyaml ]
types: [ file ]
files: (\.cmake|CMakeLists.txt)(.in)?$
# Clang format the codebase automatically
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: "v17.0.6"
hooks:
- id: clang-format
types_or: [ c++, c, cuda ]
- repo: https://github.com/python-poetry/poetry
rev: "1.8.0"
hooks:
- id: poetry-check
- id: poetry-lock
stages: [ manual ]
- id: poetry-install
stages: [ manual ]
# Check for common shell mistakes
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: "v0.10.0.1"
hooks:
- id: shellcheck
args: [ --external-sources ]
stages: [ manual ]