1+ ---
2+ # WATonomous Pre-commit Config
3+
4+ # See https://pre-commit.com for more information on these settings
5+ repos :
6+ # General-purpose sanity checks
7+ - repo : https://github.com/pre-commit/pre-commit-hooks
8+ rev : v5.0.0
9+ hooks :
10+ - id : check-added-large-files
11+ - id : check-ast
12+ - id : check-case-conflict
13+ - id : check-merge-conflict
14+ - id : check-shebang-scripts-are-executable
15+ - id : check-symlinks
16+ - id : check-toml
17+ - id : check-xml
18+ - id : end-of-file-fixer
19+ - id : forbid-submodules
20+ - id : mixed-line-ending
21+ - id : trailing-whitespace
22+
23+ # JSON (supports comments)
24+ - repo : https://gitlab.com/bmares/check-json5
25+ rev : v1.0.0
26+ hooks :
27+ - id : check-json5
28+ files : ' \.(json|json5|jsonc)$'
29+
30+ # Python (formatting + linting)
31+ - repo : https://github.com/astral-sh/ruff-pre-commit
32+ rev : v0.11.5
33+ hooks :
34+ - id : ruff-format
35+ - id : ruff
36+ args : [--fix]
37+
38+ # C++ formatting
39+ - repo : https://github.com/pre-commit/mirrors-clang-format
40+ rev : v19.1.7
41+ hooks :
42+ - id : clang-format
43+ args : ["--style=file:.config/clang-format"]
44+
45+ # C++ linting
46+ - repo : https://github.com/cpplint/cpplint
47+ rev : 2.0.0
48+ hooks :
49+ - id : cpplint
50+ args : ["--config=.cpplint.cfg", "--filter=-runtime/references", --quiet, --output=sed]
51+
52+ # CMake linting
53+ - repo : https://github.com/cmake-lint/cmake-lint
54+ rev : 1.4.3
55+ hooks :
56+ - id : cmakelint
57+ args : [--linelength=140]
58+
59+ # Bash / Shell scripts
60+ - repo : https://github.com/shellcheck-py/shellcheck-py
61+ rev : v0.10.0.1
62+ hooks :
63+ - id : shellcheck
64+ args : [-e, SC1091]
65+
66+ # Dockerfile linting
67+ - repo : https://github.com/AleksaC/hadolint-py
68+ rev : v2.12.1b3
69+ hooks :
70+ - id : hadolint
71+ args : [--ignore, SC1091, --ignore, DL3006, --ignore, DL3008]
72+
73+ # Markdown linting
74+ - repo : https://github.com/jackdewinter/pymarkdown
75+ rev : v0.9.28
76+ hooks :
77+ - id : pymarkdown
78+ args : [-d, MD013, fix]
79+
80+ # XML (ROS-specific)
81+ - repo : https://github.com/emersonknapp/ament_xmllint
82+ rev : v0.1
83+ hooks :
84+ - id : ament_xmllint
85+
86+ # YAML linting
87+ - repo : https://github.com/adrienverge/yamllint.git
88+ rev : v1.29.0
89+ hooks :
90+ - id : yamllint
91+ args : ["-c", ".config/.yamllint.yaml"]
92+
93+ # License headers
94+ - repo : https://github.com/Lucas-C/pre-commit-hooks
95+ rev : v1.5.5
96+ hooks :
97+ - id : insert-license
98+ types_or : [python, cmake, shell]
99+ name : Copyright headers for Python/CMake
100+ args :
101+ [
102+ --license-filepath,
103+ .config/copyright.txt,
104+ --comment-style,
105+ " #" ,
106+ --allow-past-years,
107+ --no-extra-eol,
108+ ]
109+ - id : insert-license
110+ types_or : [c++, c]
111+ name : Copyright headers for C/C++
112+ args : [--license-filepath, .config/copyright.txt, --comment-style, "//", --allow-past-years]
0 commit comments