-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
migrate from astyle
to clang-format
, add tests/
#8455
Conversation
a lot of changes :> |
typedef enum | ||
{ |
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.
<- I meant this
do | ||
{ | ||
} while (do_menu()); |
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.
...and this
auto t = [](const char* h, const char* n) | ||
{ |
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.
...and this, which is correct from the ruleset standpoint, but looks really weird :/
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.
Yes it is sometimes weird.
If we had another tool than astyle
we'd have less oddities.
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.
Macros also seem to break b/c of the braces detachment
I'd expect clang-format to work pretty well, with a more verbose ruleset though compared to the astyle
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.
Also see https://sourceforge.net/p/astyle/bugs/548/
Plus, for examples (where astyle conf Arduino IDE formatter link is 404 btw) IDE 2.0+ is expected migrate to clang tool as well arduino/Arduino#11543
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.
Is this better ?
I'll try to find the arduino-example configuration when I get more time (edit: done, see OP)
(edit: any change to the configuration file is welcome and can be tested in this PR)
astyle
to clang-format
, add tests/
Closing in favor of #8464 |
edit3
tests/
is added totests/restyle.sh
and appliedclang-format
is used instead of astyle,its configuration is stored into
restyle.sh