-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Clang format proposal v5 #5222
Clang format proposal v5 #5222
Conversation
clang-format allows to auto-format C code. The settings here are set up to follow the code style, see https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Coding_Style. DO NOT MERGE AS IS.
@@ -6,12 +6,191 @@ Suricata uses a fairly strict coding style. This document describes it. | |||
Formatting | |||
~~~~~~~~~~ | |||
|
|||
clang-format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doc diff can be a pain to read.
See https://github.com/roligugus/suricata/blob/clang-format-proposal-v5/doc/devguide/codebase/code-style.rst for the formatted doc.
clang-format file commit says "DO NOT MERGE AS IS." Is that still correct? |
No, argh! I forgot to update the commit message. Should I fix the commit and repush this, or wait for feedback and then fix in a potential v6? |
Yeah, that's the messy ubuntu clang versioning... Do this Fyi, Btw, you could also configure a different clang-format version to use if not specified - just don't forget to change this if you ever switch to a different clang-format version: Or simply use the helper script ;) |
Merged in #5349, thanks a lot @roligugus ! This was a much heavier lift than I would have thought beforehand. Really appreciate the work you've put into this. Now lets see how well it will fit into our workflows :) |
Continuation of #5186
Make sure these boxes are signed before submitting your Pull Request -- thank you.
Link to redmine ticket:
https://redmine.openinfosecfoundation.org/issues/3736
Describe changes:
Main other changes are...
Wrong Formatting is an Error
As per #5186 (comment), formatting produces a github action error. This will provide a better visual and show the formatting-check action as failed in your pull request...
Example formatting-check action error: https://github.com/OISF/suricata/runs/914986617?check_suite_focus=true
One can chose which actions must pass in "Branch prediction Rules" in the repo settings. You could require all actions but the "formatting-check" to pass to still allow merging even if formatting is not correct: