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 code auto-formatting to repo #273

Open
sea-bass opened this issue Sep 16, 2023 · 4 comments
Open

Add code auto-formatting to repo #273

sea-bass opened this issue Sep 16, 2023 · 4 comments

Comments

@sea-bass
Copy link
Contributor

This is something I'm happy to work on by adding in pre-commit plus a CI action to check auto-formatting.

However, before I try this I wanted to get the maintainers' go-ahead.

@fmrico
Copy link
Contributor

fmrico commented Sep 21, 2023

Hi @sea-bass

CI is already passing the usual tests, like cpplint and uncrustify. If it does the same? What more does your proposal contribute to CI? Another concern is to have the opportunity for contributors to pass the same repo CI tests in their machines.

@fmrico
Copy link
Contributor

fmrico commented Sep 21, 2023

Is this related to #248?

@sea-bass
Copy link
Contributor Author

Yes it is, and didn't realize there was already a closed PR. My apologies.

I like pre-commit because it extends beyond just C++ code -- we use it to format Python, YAML, Dockerfiles, markdown docs, etc. And it also supports running clang-format on C++.

cpplint and uncrustify are a little more work to run, and most contributors (like myself) don't realize it's even there in CI until I fail some checks.

The CONTRIBUTING.md should definitely mention how to run these locally as part of commit requirements. Just a suggestion.

@robodrome
Copy link
Contributor

Yes it is, and didn't realize there was already a closed PR. My apologies.

I like pre-commit because it extends beyond just C++ code -- we use it to format Python, YAML, Dockerfiles, markdown docs, etc. And it also supports running clang-format on C++.

cpplint and uncrustify are a little more work to run, and most contributors (like myself) don't realize it's even there in CI until I fail some checks.

The CONTRIBUTING.md should definitely mention how to run these locally as part of commit requirements. Just a suggestion.

I agree. I had some issues with formatting.

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

No branches or pull requests

3 participants