https://github.com/tier4/pre-commit-hooks-ros
ROS-related hooks for pre-commit
https://github.com/tier4/pre-commit-hooks-ros
hooks pre-commit ros ros2
Last synced: over 1 year ago
JSON representation
ROS-related hooks for pre-commit
- Host: GitHub
- URL: https://github.com/tier4/pre-commit-hooks-ros
- Owner: tier4
- License: apache-2.0
- Created: 2021-08-23T07:56:41.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-02-23T00:05:29.000Z (over 1 year ago)
- Last Synced: 2025-02-23T01:20:05.029Z (over 1 year ago)
- Topics: hooks, pre-commit, ros, ros2
- Language: Python
- Homepage:
- Size: 104 KB
- Stars: 13
- Watchers: 48
- Forks: 2
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pre-commit-hooks-ros
[ROS]-related hooks for [pre-commit]
## Usage
Write your `.pre-commit-config.yaml` as below.
```yaml
repos:
- repo: https://github.com/tier4/pre-commit-hooks-ros
rev: v0.7.0
hooks:
- id: flake8-ros
- id: prettier-xacro
- id: prettier-launch-xml
- id: prettier-package-xml
- id: ros-include-guard
- id: sort-package-xml
```
## Hooks available
### flake8-ros
Apply [flake8] with the [ROS 2 settings](https://docs.ros.org/en/rolling/Installation/Ubuntu-Development-Setup.html#install-development-tools-and-ros-tools).
### prettier-xacro
Apply [Prettier] with [plugin-xml] to [xacro].
### prettier-launch-xml
Apply [Prettier] with [plugin-xml] to [launch.xml].
### prettier-package-xml
Apply [Prettier] with [plugin-xml] to [package.xml].
### ros-include-guard
Fix the macro name of include guards.
### sort-package-xml
Sort the dependent packages in [package.xml].
If you want to exclude a tag from sorting, add `` at the beginning of the line.
```xml
rclcpp
```
[flake8]: https://github.com/PyCQA/flake8
[launch.xml]: https://design.ros2.org/articles/roslaunch_xml.html
[package.xml]: https://www.ros.org/reps/rep-0149.html
[plugin-xml]: https://github.com/prettier/plugin-xml/
[pre-commit]: https://github.com/pre-commit/pre-commit
[prettier]: https://prettier.io/
[ros]: https://ros.org/
[xacro]: http://wiki.ros.org/xacro