-
Notifications
You must be signed in to change notification settings - Fork 49
/
.pre-commit-config.yaml
131 lines (129 loc) · 3.62 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
ci:
autoupdate_schedule: quarterly
exclude: (?:^extern/)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v5.0.0'
hooks:
- id: end-of-file-fixer
exclude: |
(?x)^(
^.*\.ai|
^.*\.txt\
^extern/
)
- id: trailing-whitespace
exclude: |
(?x)^(
^.*\.ai|
^.*\.txt|
^extern/|
^setup.cfg
)
- id: check-builtin-literals
- id: check-executables-have-shebangs
- id: check-json
- id: check-yaml
- id: debug-statements
- id: requirements-txt-fixer
- repo: https://github.com/glotzerlab/fix-license-header
rev: v0.4.1
hooks:
- id: fix-license-header
name: Fix License Headers (Python)
exclude: |
(?x)(
^doc/|
^extern/|
^requirements/
)
types_or: [python, cython]
args:
- --license-file=LICENSE
- --start=2
- --num=1
- --add=This file is from the freud project, released under the BSD 3-Clause License.
- --keep-before=#!
- id: fix-license-header
name: Fix License Headers (C++)
types_or: [c, c++]
args:
- --license-file=LICENSE
- --start=2
- --num=1
- --add=This file is from the freud project, released under the BSD 3-Clause License.
- --comment-prefix=//
- repo: https://github.com/asottile/pyupgrade
rev: 'v3.17.0'
hooks:
- id: pyupgrade
args:
- --py36-plus
- repo: https://github.com/PyCQA/isort
rev: '5.13.2'
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: '24.8.0'
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: '7.1.1'
hooks:
- id: flake8
types: ["file"]
types_or: ["python", "cython"]
additional_dependencies: ["flake8-force"]
args:
- --show-source
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v19.1.1'
hooks:
- id: clang-format
types_or: [c, c++]
# The following pre-commit hooks should only be run manually because they have
# dependencies that cannot be pip installed.
- repo: local
hooks:
- id: clang-tidy
stages: [manual] # Requires clang-tidy.
name: clang-tidy
entry: clang-tidy
language: system
types: [c++]
# Exclude external files. Also exclude AABB.h because it uses intrinsics
# heavily and these are not considered portable.
exclude: |
(?x)^(
^cpp/locality/AABB\.h|
^extern/
)
args:
- --warnings-as-errors=*
- id: cppcheck
stages: [manual] # Requires cppcheck.
# Ignore external files and those taken verbatim from HOOMD.
name: cppcheck
entry: cppcheck
language: system
types: [c++]
# Exclude external files. Also exclude AABB.h because it uses intrinsics
# heavily and these are not considered portable.
exclude: |
(?x)^(
^cpp/locality/AABB\.h|
^extern/
)
args:
- cpp/
- --enable=warning,style,performance,portability # Ignore unused (could be used by Cython).
- --std=c++14
- --language=c++ # Force C++ for .h header files.
- --inline-suppr # Enable inline suppresions of warnings.
- --suppress=*:cpp/locality/AABB.h
- --suppress=*:extern/*
- --error-exitcode=1