Giter Site home page Giter Site logo

action-ros-lint's Introduction

action-ros-lint

GitHub Action Status Dependabot Status

This action runs ROS 2 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

Usage

See action.yml

Basic

container:
  image: ubuntu:noble
steps:
- uses: actions/checkout@v4
- 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

jobs:
  ament_lint:
    runs-on: ubuntu-latest
    container:
      image: ubuntu:noble
    strategy:
      fail-fast: false
      matrix:
          linter: [copyright, flake8, mypy, pep257, pep8, xmllint]
    steps:
    - uses: actions/checkout@v4
    - 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.

jobs:
  ament_lint:
    runs-on: ubuntu-latest
    container:
      image: ghcr.io/ros-tooling/setup-ros-docker/setup-ros-docker-ubuntu-noble-ros-jazzy-ros-base
    strategy:
      fail-fast: false
      matrix:
          linter: [copyright, flake8, mypy, pep257, pep8, xmllint]
    steps:
    - uses: actions/checkout@v4
    - 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

action-ros-lint's People

Contributors

christophebedard avatar conroy-cheers avatar ct2034 avatar david-prody avatar dependabot-preview[bot] avatar dependabot[bot] avatar emersonknapp avatar github-actions[bot] avatar greenkeeper[bot] avatar mikaelarguedas avatar mosfet80 avatar ros-tooling-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

action-ros-lint's Issues

Different results from ament_flake8 when run locally

Description

I am not sure if this is the same problem as #318, but it might be.
I also get different results when running ament_flake8 locally vs in the github action (https://github.com/ros/diagnostics/actions/runs/3875359248/jobs/6607784527)

Expected Behavior

Github action and local should result in the same output.

Actual Behavior

Locally I get:

14 files checked
No problems found
...

To Reproduce

Locally I have also ros-rolling-ament-flake8 installed.
And run it with ament_flake8 $(colcon list --packages-select diagnostic_aggregator diagnostic_common_diagnostics diagnostic_updater self_test -p)

System (please complete the following information)

Additional context

See ros/diagnostics#268

An in-range update of @typescript-eslint/eslint-plugin is breaking the build 🚨

The devDependency @typescript-eslint/eslint-plugin was updated from 2.19.0 to 2.19.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@typescript-eslint/eslint-plugin is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • test: There are 1 failures, 0 warnings, and 0 notices.

Release Notes for v2.19.1

2.19.1 (2020-02-10)

Bug Fixes

  • eslint-plugin: [unbound-method] blacklist a few unbound natives (#1562) (4670aab)
  • typescript-estree: ts returning wrong file with project references (#1575) (4c12dac)
Commits

The new version differs by 5 commits.

  • 1c8f0df chore: publish v2.19.1
  • 4c12dac fix(typescript-estree): ts returning wrong file with project references (#1575)
  • e9cf734 docs(eslint-plugin): fix typo in readme
  • 10d86b1 docs(eslint-plugin): [no-dupe-class-members] fix typo (#1566)
  • 4670aab fix(eslint-plugin): [unbound-method] blacklist a few unbound natives (#1562)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/node is breaking the build 🚨

The devDependency @types/node was updated from 13.5.0 to 13.5.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • test: There are 1 failures, 0 warnings, and 0 notices.

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet.
We recommend using:

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

An in-range update of @typescript-eslint/parser is breaking the build 🚨

The devDependency @typescript-eslint/parser was updated from 2.19.0 to 2.19.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@typescript-eslint/parser is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • test: There are 1 failures, 0 warnings, and 0 notices.

Release Notes for v2.19.1

2.19.1 (2020-02-10)

Bug Fixes

  • eslint-plugin: [unbound-method] blacklist a few unbound natives (#1562) (4670aab)
  • typescript-estree: ts returning wrong file with project references (#1575) (4c12dac)
Commits

The new version differs by 5 commits.

  • 1c8f0df chore: publish v2.19.1
  • 4c12dac fix(typescript-estree): ts returning wrong file with project references (#1575)
  • e9cf734 docs(eslint-plugin): fix typo in readme
  • 10d86b1 docs(eslint-plugin): [no-dupe-class-members] fix typo (#1566)
  • 4670aab fix(eslint-plugin): [unbound-method] blacklist a few unbound natives (#1562)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Remove dependency on setup-ros

Description

action-ros-lint depends on rosdep and a ROS 2 APT repo to install "ros-$rosDistro-ament-$linterTool" and expects "/opt/$rosDistro/setup.sh" to exist. This makes it awkward to run action-ros-lint on a ROS 1 package since it requires setup-ros-* to be configured with a ROS 2 distro.

Completion Criteria

  • It should be possible to run action-ros-lint without an implicit dependency on a ROS 2 environment.

Implementation Notes / Suggestions

  • ament_lint can be installed by PIP. A possible solution could be to add a "distribution" that installs the linters using PIP instead of APT.
  • action-ros-lint could assume that the linters have been installed through a previous step. setup-ros-* should install the linters when it installs ros-$rosDistro-desktop.

Testing Notes / Suggestions

[question] what ament_lint extensions are installed / ran with this action?

I used to know this but have somehow forgotten and cannot find it documented anywhere (but it probably is).

For some reason my local-install of galactic is not reporting any flake8 errors for my package but this action in CI is saying there are some.

I'm guessing there are some extensions (apt install deps probably) I am missing locally. Could someone point me to them?

Support installing of linters using pip to support projects that don't have a ROS 2 workspace.

Description

Right now, action-ros-lint always installs the linters from APT. It should be possible to configure action-ros-lint to install the ament linters using pip so projects that don't require a ROS 2 workspace can use these linters.

Examples:

Completion Criteria

  • A feature is added to action-ros-lint to install from pip
  • Update README.md

Implementation Notes / Suggestions

Testing Notes / Suggestions

Request for more general tags

Description

As @emersonknapp brought up in ros-tooling/action-ros-ci#462, it would be useful to have more general tags, such as vMAJOR.MINOR which tracks the latest patch MAJOR.MINOR.*. This way, users can use these more broad version tags so their CI stays up to date without needing to manually bump the version with each upstream patch.

Related Issues

Similar work was already done in the action-ros-ci and setup-ros repos, as documented by ros-tooling/action-ros-ci#462.

It's less critical here since this repo updates less often, but would still be nice.

Completion Criteria

package-name required for linting large metapackage project

Description

** clear and concise description of the bug is **

I'm looking to add the linter stage to Nav2, which contains a large number of growing packages

Expected Behavior

** clear and concise description of what you expected to happen **

Not have to manually specify each

Actual Behavior

** clear and concise description of what actually happened. include copied logs whenever possible **

Have to manually specify each package-name

Additional context

** Add any other context about the problem here **

Can this not simply test for all set linters for all packages it finds?

Ability to pass extra options to ament linters

Hi All,

Would it be possible to pass options in CI? For example I would like to run ament_cppcheck with --language c++ or ament_pep8 with --linelength .

I also have one suggestion, I think the package should pass the check if there is no c++ file in the package and ament_cppcheck's output is no No files found.

Thanks a lot.
Sina

ament_lint_flake8 fails because of new version of flake8

Description

Master branch of ament_lint has a fix for flake8 3.8. Until that is released as an official version, though, we have 2 options to get things green again

  1. Install the master branch of ament_flake8
  2. Install flake8<3.8

Expected Behavior

Linting passes

Actual Behavior

Linting fails, e.g. https://github.com/ros2/rosbag2/pull/409/checks?check_run_id=671766785

To Reproduce

N/A

System (please complete the following information)

N/A

Additional context

N/A

clang_format fails with GitHub action but passes locally

Description

I am using a custom clang-format style and when running the clang_format linter locally (colcon test), it passes without suggested code changes. In the GitHub action, this fails, suggesting changes that should not be suggested according to custom format style.

E.g. the linter on the GitHub action suggests:

Error: -       for (const libcamera::Size &size : formats.sizes(pixelformat))
Error: +       for (const libcamera::Size & size : formats.sizes(pixelformat))

while the format style defines:

PointerAlignment: Right

Expected Behavior

GitHub action should behave the same as locally.

Actual Behavior

clang-format behaviour differs between local installation and GitHub action

To Reproduce

  1. create custom clang-format style
  2. adapt code
  3. test locally
  4. test remote via action-ros2-lint

System (please complete the following information)

  • OS: Ubuntu 20.04
  • ROS 2 Distro: foxy

Additional context

It appears that the local and remove clang-format versions differ:

local clang (Ubuntu repo):

$ clang-format --version
clang-format version 10.0.0-4ubuntu1

ros-tooling/action-ros2-lint:

Unpacking clang-format (1:10.0-50~exp1)

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet.
We recommend using:

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.