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

CMake: Pre-Commit Hook to Gersemi for auto-formatting #1722

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

enetheru
Copy link
Contributor

I found an auto formatter inspired by black.
This is what would happen if it was added to the pre-commit hooks

@dsnopek
Copy link
Collaborator

dsnopek commented Feb 26, 2025

If we're good with the code style that this enforces, I'd personally be in support this. Auto formatting makes managing changes from multiple contributors easier.

Does this PR also affect CI? Like, will builds fail if the code in the PR doesn't match the auto formatting?

@enetheru
Copy link
Contributor Author

If we're good with the code style that this enforces, I'd personally be in support this. Auto formatting makes managing changes from multiple contributors easier.

Only larger generator expressions get mangled, but i've put in some directives to turn off the auto formatter for them.
The code style isnt to my preference, but neither is everything else.

Does this PR also affect CI? Like, will builds fail if the code in the PR doesn't match the auto formatting?

Sure does. exactly the same behaviour as existing hooks.

@enetheru enetheru marked this pull request as ready for review March 1, 2025 01:34
@enetheru enetheru requested review from a team as code owners March 1, 2025 01:34
@dsnopek
Copy link
Collaborator

dsnopek commented Mar 1, 2025

Looks good, but I think this should be squashed down to a single commit

@enetheru
Copy link
Contributor Author

enetheru commented Mar 1, 2025

yup, I had them separate so you culd see the human vs gersemi changes. I'll squish now.

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