diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..3414e10 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,39 @@ +--- + +repos: + - repo: https://github.com/polymathrobotics/polymath_code_standard + rev: v2.1.1 + hooks: + # Everything + - id: polymath-general + - id: polymath-copyright + args: [--license, Apache-2.0, --wildcard-copyright-org, --reuse-style] + # Implementation + - id: polymath-json + - id: polymath-python + # Mark(up/down) + - id: polymath-markdown + - id: polymath-shell + # Lint shipped/deployment shell (host/setup/*). The dev-only bench and + # chaos harnesses under test/ and tools/ rely on intentional word + # splitting (tc/netem/curl argument expansion, e.g. `netem $1`), so they + # are exempt here rather than peppered with disable directives. + exclude: ^(test/|tools/).*\.sh$ + - id: polymath-xml + - id: polymath-yaml + + # Opt-in gate for the ROS 2 ament linters that ros2_build.yml enforces + # (flake8 / pep257 / uncrustify / xmllint / lint_cmake on jazzy). Runs ONLY on + # `git push`, never on commit or `pre-commit run --all-files`, so it does not + # slow the normal flow. Needs Docker; no local ROS install. Enable with + # `pre-commit install --hook-type pre-push`; skip once with `git push + # --no-verify` or `SKIP=ros2-ament-lint git push`. + - repo: local + hooks: + - id: ros2-ament-lint + name: ROS 2 ament lint (jazzy, via Docker) + entry: scripts/ros2_lint.sh + language: script + stages: [pre-push] + pass_filenames: false + files: ^(ros2|archive)/ \ No newline at end of file