Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add precommit to Nav2 #4769

Open
tonynajjar opened this issue Nov 28, 2024 · 4 comments
Open

Add precommit to Nav2 #4769

tonynajjar opened this issue Nov 28, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@tonynajjar
Copy link
Contributor

Feature request

Feature description

Fixing linting issues after CI runs is always a pain. Giving the option for contributors to use pre-commit to fix all linting issues before pushing would lead to a smoother workflow, not to mention the saving of some CI time

@padhupradheep padhupradheep added the enhancement New feature or request label Nov 29, 2024
@SteveMacenski
Copy link
Member

We have the CI linting-only jobs that should be accelerating that by checking the linters separate of the build / test stages. https://github.com/ros-navigation/navigation2/blob/main/.github/workflows/lint.yml I believe this already does what you intend?

@SteveMacenski
Copy link
Member

You should be seeing those job results in the GitHub GUI in the same way as a precommit job #4761

@tonynajjar
Copy link
Contributor Author

Yes it's already great that the linting job runs before the long build and testing jobs but I meant to bring it one step closer to the developer (optionally). So what I'm proposing is a pre-commit config file (or similar) that will basically run the same thing as this linting job but locally before commiting (e.g. pre-commit setups a virtual environment). The user would need to run pre-commit install on their local Nav2 repo to "opt-in".
This would help fix linting issues before even committing which would save some time

@SteveMacenski
Copy link
Member

We could do that, yes. However I do wonder if it is necessary with good process. You should be running colcon test on the packages that you modify (at least) and as part of that, the linters are run. Running the tests are important before opening a PR to begin with to make sure you don't break existing behavior.

With all that said, if you added a precommit option, I'd merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants