-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
151 lines (150 loc) · 4.54 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
140
141
142
143
144
145
146
147
148
149
150
151
ci:
skip: # cant resolve executable in pre-commit.ci Service
[
black,
check-added-large-files,
check-toml,
check-yaml,
end-of-file-fixer,
trailing-whitespace,
clang-format,
cpplint,
cppcheck,
pyupgrade,
]
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version. TODO: remove flake8 in future
rev: "v0.1.1"
hooks:
- id: ruff
args: [--fix]
- repo: https://github.com/psf/black
rev: 23.10.1
hooks:
- id: black
name: black
entry: black
language: system
types: [python]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0 # Use the ref you want to point at
hooks:
- id: check-added-large-files
name: Check for added large files
entry: check-added-large-files
language: system
exclude: |
(?x)^(
inst/_cornflakes/strtk/strtk.hpp|pytest
)$
- id: check-toml
name: Check Toml
entry: check-toml
language: system
types: [toml]
- id: check-yaml
name: Check Yaml
entry: check-yaml
language: system
types: [yaml]
args: ["--unsafe"]
- id: end-of-file-fixer
name: Fix End of Files
entry: end-of-file-fixer
language: system
types: [text]
stages: [commit, push, manual]
exclude: docs/
- id: trailing-whitespace
name: Trim Trailing Whitespace
entry: trailing-whitespace-fixer
language: system
types: [text]
stages: [commit, push, manual]
- repo: https://github.com/pocc/pre-commit-hooks
rev: v1.3.5
hooks:
- id: clang-format
args: [--style=Google]
- id: cpplint
args:
[
--exclude=inst/ext/*,
--exclude=inst/_cornflakes/datetime_utils.hpp,
--exclude=cmake-build-debug/*,
--filter=-build/c++11,
]
- id: cppcheck
name: cppcheck
entry: cppcheck
language: system
args:
[
inst/cornflakes,
"--suppress=syntaxError:inst/_cornflakes/datetime_utils.hpp",
-DVERSION_INFO=$VERSION_INFO,
--std=c++17,
]
files: \.(c|h|cpp)$
- repo: https://github.com/pycqa/flake8
rev: "6.1.0" # pick a git hash / tag to point to
hooks:
- id: flake8
name: flake8
entry: flake8
language: python
types: [python]
require_serial: true
additional_dependencies: [Flake8-pyproject]
- repo: https://github.com/PyCQA/autoflake
rev: v2.2.1
hooks:
- id: autoflake
name: autoflake
entry: autoflake
language: python
"types": [python]
require_serial: true
args:
- "--in-place"
- "--expand-star-imports"
- "--remove-duplicate-keys"
- "--remove-unused-variables"
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
name: pyupgrade
description: Automatically upgrade syntax for newer versions.
entry: pyupgrade
language: system
types: [python]
args: [--py38-plus]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
hooks:
- id: prettier
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
- id: isort
name: isort (cython)
types: [cython]
- id: isort
name: isort (pyi)
types: [pyi]
- 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)?$
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.27.0
hooks:
- id: check-github-actions
- id: check-github-workflows