Skip to content

Commit 0833719

Browse files
committed
tooling: Add pre-commit configuration
1 parent b228ecb commit 0833719

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

.pre-commit-config.yaml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
repos:
2+
# Everything:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v3.3.0
5+
hooks:
6+
- id: check-added-large-files
7+
- id: check-case-conflict
8+
- id: check-executables-have-shebangs
9+
- id: check-json
10+
exclude: ^.vscode/.+\.json$
11+
- id: check-merge-conflict
12+
- id: check-toml
13+
- id: check-xml
14+
- id: check-yaml
15+
- id: end-of-file-fixer
16+
exclude: .+\.patch$
17+
- id: forbid-new-submodules
18+
- id: no-commit-to-branch
19+
args: [--branch=master]
20+
- id: trailing-whitespace
21+
exclude: .+\.patch$
22+
- repo: https://github.com/codespell-project/codespell
23+
rev: v2.0.0
24+
hooks:
25+
- id: codespell
26+
args:
27+
- --ignore-words-list=
28+
- --skip="./.*"
29+
- --quiet-level=2
30+
31+
# C++:
32+
- repo: local
33+
hooks:
34+
- id: generate-compilation-database
35+
name: Generate compilation database
36+
language: system
37+
pass_filenames: false
38+
entry: bash -c 'make configure-select; find -name compile_commands.json -exec cat {} \; | jq -s ".[]" > compile_commands.json'
39+
files: .*\.(c|cpp|h|hpp)$
40+
- repo: https://github.com/pocc/pre-commit-hooks
41+
rev: v1.1.1
42+
hooks:
43+
- id: clang-format
44+
- id: clang-tidy
45+
46+
# Python:
47+
- repo: https://github.com/asottile/pyupgrade
48+
rev: v2.7.4
49+
hooks:
50+
- id: pyupgrade
51+
args: [--py3-only, --py36-plus]
52+
types: [python]
53+
files: ^cli/
54+
- repo: https://github.com/psf/black
55+
rev: 20.8b1
56+
hooks:
57+
- id: black
58+
args:
59+
- --quiet
60+
- --safe
61+
types: [python]
62+
files: ^cli/
63+
- repo: https://gitlab.com/pycqa/flake8
64+
rev: 3.7.9
65+
hooks:
66+
- id: flake8
67+
additional_dependencies:
68+
- flake8-docstrings==1.5.0
69+
- pydocstyle==5.0.2
70+
args: [--max-line-length=160, --ignore=D102]
71+
types: [python]
72+
files: ^cli/
73+
- repo: https://github.com/pycqa/bandit
74+
rev: 1.6.2
75+
hooks:
76+
- id: bandit
77+
args:
78+
- --quiet
79+
types: [python]
80+
files: ^cli/
81+
- repo: https://github.com/pycqa/isort
82+
rev: 5.6.4
83+
hooks:
84+
- id: isort
85+
types: [python]
86+
files: ^cli/
87+
- repo: https://github.com/pre-commit/mirrors-mypy
88+
rev: v0.812
89+
hooks:
90+
- id: mypy
91+
types: [python]
92+
files: ^cli/

0 commit comments

Comments
 (0)