-
Notifications
You must be signed in to change notification settings - Fork 42
/
.pre-commit-config.yaml
156 lines (145 loc) · 5.17 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
152
153
154
155
156
minimum_pre_commit_version: 2.9.3
default_language_version:
# Force all unspecified python hooks to run python3
python: python3
ruby: 2.7.2
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- name: Trim trailing whitespaces
id: trailing-whitespace
- name: Add empty line to end of file
id: end-of-file-fixer
- name: Check that exectuables have shebangs
id: check-executables-have-shebangs
- name: Check XML file syntax parseability
id: check-xml
- name: Check JSON file syntax parseability
id: check-json
- name: Check YAML file syntax parseability
id: check-yaml
args: [ --allow-multiple-documents ]
- name: Block commits to main branch
id: no-commit-to-branch
args: [ '--branch', 'main' ]
- name: Check that no large files were added (>500kB)
id: check-added-large-files
args: [ "--maxkb=500" ]
- name: Checks that no unresolved merge conflict are committed
id: check-merge-conflict
- repo: https://github.com/google/yapf
rev: v0.40.2
hooks:
- name: Format python files with yapf
id: yapf
- repo: https://github.com/PyCQA/pylint
rev: v3.1.0
hooks:
- name: Lint python files with pylint
id: pylint
args: [ --rcfile=tooling/git_hook_configs/.pylintrc ]
- repo: local
hooks:
- name: Format C++ files with clang-format
id: clang-format
language: system
files: \.(c|cc|cxx|cpp|h|hpp|hxx)$
entry: clang-format-11 -i
args: [ -style=file ]
- name: Check C++ file style with cpplint
id: cpplint
language: python
files: \.(c|cc|cxx|cpp|h|hpp|hxx)$
entry: cpplint
args: [ "--verbose=3" ]
- name: Check C++ file correctness with cppcheck
id: cppcheck
description: Check correctness of C code using cppcheck.
language: system
files: \.(c|cc|cxx|cpp|h|hpp|hxx)$
entry: cppcheck --error-exitcode=1
args: [ --std=c++17, --language=c++, --force, --quiet,
--library=googletest, --library=tooling/cppcheck/gazebo,
"--enable=warning,performance,portability",
"--suppress=constStatement",
"--suppress=syntaxError:*test/*/test_*.cc",
"--suppress=assignBoolToPointer:library/python/*"]
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- name: Format CMake files with cmake-format
id: cmake-format
args: [ --config-files, tooling/git_hook_configs/.cmake-format.yaml ]
additional_dependencies: [ pyyaml>=5.1 ]
- name: Lint CMake files with cmake-lint
id: cmake-lint
additional_dependencies: [ pyyaml>=5.1 ]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- name: Check shell scripts with shellcheck
id: shellcheck
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- name: Lint dockerfiles with hadolint
id: hadolint
args: [ --config=tooling/git_hook_configs/.hadolint.yaml ]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.2
hooks:
- name: Check GitHub workflow file schema conformance
id: check-github-workflows
- name: Check GitHub action files schema conformance
id: check-github-actions
- name: Check wavemap's custom schema definitions
id: check-metaschema
files: ^tooling/schemas/wavemap/.*\.(json)$
- name: Check wavemap config files
id: check-jsonschema
files: ^(|.*\/)wavemap(|_\w+)\.yaml$
args: [ --schemafile=tooling/schemas/wavemap/wavemap_config.json ]
- repo: https://github.com/markdownlint/markdownlint
rev: v0.12.0
hooks:
- name: Lint markdown files with markdownlint
id: markdownlint
args: [ --rules="~MD013" ]
- repo: https://github.com/rstcheck/rstcheck
rev: v6.2.0
hooks:
- name: Check syntax of reStructuredText
id: rstcheck
additional_dependencies: [ sphinx ]
args: [ --report-level=warning ]
- repo: local
hooks:
- name: Check ROS package manifest schema conformance
id: xmllint
entry: xmllint --noout
language: system
types: [ file ]
files: (package.xml)$
args: [ --schema, tooling/schemas/xml/package_format2.xsd ]
- name: Check ROS launch file schema conformance
id: xmllint
entry: xmllint --noout
language: system
types: [ file ]
files: \.(launch)$
args: [ --schema, tooling/schemas/xml/roslaunch.xsd ]
- name: Check (ROS) URDF file schema conformance
id: xmllint
entry: xmllint --noout
language: system
types: [ file ]
files: \.(urdf)$
args: [ --schema, tooling/schemas/xml/package_format2.xsd ]
# - name: Check (ROS) SDF file schema conformance
# id: xmllint
# entry: xmllint --noout
# language: system
# types: [ file ]
# files: \.(sdf|model|world)$
# args: [ --schema, tooling/schemas/xml/sdf.xsd ]