Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ros-tooling/action-ros-lint
Github action to run linters on ROS 2 packages
https://github.com/ros-tooling/action-ros-lint
ci colcon linter ros2
Last synced: 3 months ago
JSON representation
Github action to run linters on ROS 2 packages
- Host: GitHub
- URL: https://github.com/ros-tooling/action-ros-lint
- Owner: ros-tooling
- License: apache-2.0
- Created: 2019-10-18T20:15:00.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-18T02:37:15.000Z (10 months ago)
- Last Synced: 2024-07-22T23:35:18.008Z (4 months ago)
- Topics: ci, colcon, linter, ros2
- Language: TypeScript
- Homepage:
- Size: 21.7 MB
- Stars: 19
- Watchers: 11
- Forks: 7
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- awesome-robotic-tooling - action-ros-lint - GitHub action to run linters on ROS 2 packages. (Development Environment / Lint and Format)
README
# action-ros-lint
[![GitHub Action Status](https://github.com/ros-tooling/action-ros-lint/workflows/Test%20action-ros-lint/badge.svg)](https://github.com/ros-tooling/action-ros-lint)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=ros-tooling/action-ros-lint)](https://dependabot.com)This action runs [ROS 2](https://index.ros.org/doc/ros/) linters on a ROS 2 package.
This command does not compile any code intentionally to make it as fast as possible (<2 min).
The objective is to give contributors feedback about their change quickly.
It may also be used to avoid wasting CI resources (no need to compile, and run the tests if it does not pass the linters).For linting requiring to compile code, or to compile and run tests, [ros-tooling/action-ros-ci] can be used instead.
## Developing
For development and release workflows, see [DEVELOPING.md](DEVELOPING.md)
## Usage
See [action.yml](action.yml)
### Basic
```yaml
container:
image: ubuntu:bionic
steps:
- uses: actions/checkout@v2
- uses: ros-tooling/setup-ros@master
- uses: ros-tooling/action-ros-lint@master
with:
linter: copyright
package-name: your_package_name
```### Run generic and Python linters
```yaml
jobs:
ament_lint:
runs-on: ubuntu-latest
container:
image: ubuntu:bionic
strategy:
fail-fast: false
matrix:
linter: [copyright, flake8, mypy, pep257, pep8, xmllint]
steps:
- uses: actions/checkout@v2
- uses: ros-tooling/setup-ros@master
- uses: ros-tooling/action-ros-lint@master
with:
linter: ${{ matrix.linter }}
package-name: your_package_name
```### Run generic and Python linters using a custom Docker image (experimental)
Using a custom Docker image removes the need to run `setup-ros`, which makes the
runs less flaky, and faster. This setup is new, and experimental.The docker image is provided by [ros-tooling/setup-ros-docker].
```yaml
jobs:
ament_lint:
runs-on: ubuntu-latest
container:
image: rostooling/setup-ros-docker:ubuntu-bionic-ros-eloquent-ros-base-latest
options: -u root # setup-node requires root access
strategy:
fail-fast: false
matrix:
linter: [copyright, flake8, mypy, pep257, pep8, xmllint]
steps:
- uses: actions/checkout@v2
- uses: ros-tooling/action-ros-lint@master
with:
linter: ${{ matrix.linter }}
package-name: your_package_name
```## License
The scripts and documentation in this project are released under the [Apache 2](LICENSE)
[ros-tooling/action-ros-ci]: https://github.com/ros-tooling/action-ros-ci
[ros-tooling/setup-ros-docker]: https://github.com/ros-tooling/setup-ros-docker