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

[Code Style] [merge after #565] add pre-commit tool #566

Merged
merged 10 commits into from
Oct 28, 2023

Conversation

Li-Jinjie
Copy link
Collaborator

What is this

This PR introduces a plugin, pre-commit, which can check coding styles and format the code automatically.

Details

To install, please read doc in ./docs folder. In general, there are only two commands needed to be executed.

    pip3 install pre-commit
    pre-commit install

Then this plugin will automatically triggered before each commit. I have included several check items inside the .pre-commit-config.yaml. Now I use black to format Python code and clang to format C++.

If the commit cannot pass the check, just run commit again. The plugin will format the code automatically and then the second commit will pass.

The C++ code style follows ROS guidance: http://wiki.ros.org/CppStyleGuide.

@tongtybj tongtybj merged commit 6d28485 into jsk-ros-pkg:master Oct 28, 2023
6 checks passed
@Li-Jinjie Li-Jinjie deleted the only_add_pre-commit branch November 5, 2023 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants