-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
112 lines (100 loc) · 2.6 KB
/
.pre-commit-config.yaml
File metadata and controls
112 lines (100 loc) · 2.6 KB
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
# To use:
#
# pre-commit run -a
#
# Or:
#
# pre-commit install # (runs every time you commit in git)
#
# To update this file:
#
# pre-commit autoupdate
#
# See https://github.com/pre-commit/pre-commit
repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-docstring-first
- id: check-merge-conflict
- id: check-symlinks
- id: check-xml
- id: check-yaml
args: [--allow-multiple-documents]
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
exclude_types: [rst]
# XML Formatting
- repo: https://github.com/efrecon/pre-commit-hook-lxml
rev: v0.1.4
hooks:
- id: format-xml
files: \.(xml|urdf|srdf|xacro)$
exclude: (^|/)package\.xml$
args: [--write, --self-closing, nospace]
# YAML Formatting
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.15.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, '2', --offset, '0']
# CPP Checks
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v20.1.4
hooks:
- id: clang-format
name: Clang Format
args: [--style=file]
files: \.(cpp|hpp|h|c|cc)$
- repo: local
hooks:
- id: cppcheck
name: Cppcheck
entry: bash -c "cppcheck --force --quiet --inline-suppr --error-exitcode=1 --language=c++ $(find . -type d -name 'cmake-build-*' -prune -false -o -name '*.cpp' -o -name '*.hpp' -o -name '*.h' -o -name '*.c' -o -name '*.cc')"
language: system
files: \.(cpp|cc|hpp|h)$
pass_filenames: false
# Python hooks
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.7
hooks:
- id: ruff-check
args: [--fix]
- id: ruff-format
# CMake Formatting
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format
- id: cmake-lint
# Package XML
- repo: https://github.com/Joschi3/package_xml_validation.git
rev: v1.4.2
hooks:
- id: format-package-xml
name: Validate and Format package.xml
# Yaml launch and config files
- repo: https://github.com/Joschi3/launch_config_validator.git
rev: v0.1.2
hooks:
- id: format-yaml-launch-and-configs
name: Validate ROS2 launch and config YAML files
# Spellcheck
#- repo: https://github.com/crate-ci/typos
# rev: v1.34.0
# hooks:
# - id: typos
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.33.2
hooks:
- id: check-github-workflows
args: [--verbose]
- id: check-github-actions
args: [--verbose]
- id: check-gitlab-ci
args: [--verbose]
- id: check-compose-spec
args: [--verbose]