-
Notifications
You must be signed in to change notification settings - Fork 11
/
.pre-commit-config.yaml
126 lines (126 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
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# Read the full text in the LICENSE.GPL file in the doc directory.
default_stages: [pre-commit, pre-push, manual]
# General
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
exclude: '^.*\.pgm$'
- id: end-of-file-fixer
exclude: '^.*\.pgm$'
- id: check-added-large-files
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-xml
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.6
hooks:
- id: clang-format
types_or: [c++, c]
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.35.1
hooks:
- id: yamllint
args: ['--config-file=.config.yaml']
- repo: https://github.com/jorisroovers/gitlint
rev: v0.19.1
hooks:
- id: gitlint
stages: [commit-msg]
- id: gitlint-ci
args: ["--commits", "origin/HEAD..HEAD"]
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: forbid-crlf
- id: remove-crlf
- id: insert-license
files: \.(clp|pddl)$
args:
- --fuzzy-match-generates-todo
- --license-filepath
- .LICENSE
- --comment-style
- ;
- --use-current-year
- --allow-past-years
- id: insert-license
files: \.(cpp|hpp)$
args:
- --fuzzy-match-generates-todo
- --license-filepath
- .LICENSE
- --comment-style
- //
- --use-current-year
- --allow-past-years
- id: insert-license
files: \.(py|bash|sh)$
args:
- --fuzzy-match-generates-todo
- --license-filepath
- .LICENSE
- --use-current-year
- --allow-past-years
# C++
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format
args: [--in-place, --config, .cmake-format]
- id: cmake-lint
args: [-c=.cmakelint.py]
exclude: etc/cmake/
# Python
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
language_version: python3
args: [--line-length=120]
additional_dependencies: [pip-autoremove]
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.13.0
hooks:
- id: reorder-python-imports
args:
- --py39-plus
- repo: https://github.com/pycqa/flake8
rev: '7.0.0'
hooks:
- id: flake8
exclude: .cmakelint.py
args:
- --max-line-length=120
- --ignore=E203,W503
- repo: https://github.com/PyCQA/autoflake.git
rev: 'v2.3.1'
hooks:
- id: autoflake
name: Remove unused variables and imports
args:
- --in-place
- --expand-star-imports
- --remove-duplicate-keys
- --remove-unused-variables
- --remove-all-unused-imports
# XML
- repo: local
hooks:
- id: xmllint
name: xmllint
entry: xmllint
args: ["--noout"]
language: system
types: [xml]