Add pre-commit hooks for clang-format, flake8, cmake-lint, shellcheck and copyright#167
Merged
Add pre-commit hooks for clang-format, flake8, cmake-lint, shellcheck and copyright#167
Conversation
mfaferek93
previously approved these changes
Feb 7, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a repository-level pre-commit configuration to run common formatting/linting checks locally (aligned with the ROS 2 / ament lint workflow), and applies small cleanups/headers/docs updates needed for the new checks.
Changes:
- Add
.pre-commit-config.yamland.flake8to enable local lint/format hooks (clang-format, flake8, cmake-lint, shellcheck, copyright). - Add missing Apache 2.0 headers to Python files and fix a few flake8/shellcheck issues.
- Document pre-commit setup in
README.mdandCONTRIBUTING.md.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/generate_verification.py |
Adds license header + flake8-driven formatting tweaks. |
docs/conf.py |
Adds license header to Sphinx config. |
README.md |
Documents pre-commit installation and usage. |
CONTRIBUTING.md |
Adds pre-commit installation step to contributor workflow. |
.pre-commit-config.yaml |
Defines pre-commit hooks for formatting/linting/copyright. |
.flake8 |
Adds flake8 configuration intended to match ament defaults. |
.devcontainer/setup-env.sh |
Addresses shellcheck warnings and minor formatting. |
…, and copyright - Add .pre-commit-config.yaml with hooks matching ament_lint tooling - Add .flake8 config matching ament_flake8 defaults (ROS 2 Jazzy) - Add missing Apache 2.0 headers to docs/conf.py and generate_verification.py - Fix shellcheck warnings in setup-env.sh - Fix flake8 violations in generate_verification.py (E203, E501) - Document pre-commit setup in README.md and CONTRIBUTING.md
84d79fd to
5c4471b
Compare
mfaferek93
approved these changes
Feb 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Summary
Add pre-commit hooks for clang-format, flake8, cmake-lint, shellcheck and copyright
Issue
Link the related issue (required):
Type
Testing
How was this tested / how should reviewers verify it?
precommit run all fixes
Checklist