-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[style] Enforce clang-format style. #74
Conversation
turon
commented
Mar 18, 2020
•
edited
Loading
edited
- Adds github hook to confirm style conformance on each push and pull request
- Locks clang-format tool to version 9
- Updates code tree to enforce style guide
I'm personally a fan of the updates, but these are arbitrary choices that we should agree on and stop changing. Can we agree to stop moving this around soon? |
I agree. We can certainly use this PR to get final agreement. Note that even running The style guide in this PR takes the one OpenThread uses with two minor modifications carried over from the old one:
|
That shouldn't have been the case, unless a lot of code has been introduced since I landed .clang-format and a pretty-fied tree last week. invoking the build in the tree should have automatically updated the code to the standard... I suppose if one made a PR without building the code (or including the reformattting in the commit, or building without clang-format being installed), one could sneak in unformatted code :-( |
Perhaps it's related to the version of clang-format being used. OpenThread and the current build system enforce that clang-format-6.0 is always used to guarantee the results are always the same. Regardless of that, it does appear that sources in master are not all following the .clang-format that is there. Just PointerAlignment for example, some files have Right (AsyncDNSResolver.h), some Middle, and some Left (InitEndPointBasis in EndPointBasis.h). |
I think it's actually that a lot of code has come in on machines without clang-format, then we changed the build system over to nlbuild-autotools, which removed support for auto-reformatting altogether. I don't see this being an issue going forward if we can get hooks running on this repo soon. |
Where does clang-format 6.0 come from for MacOS? I'd really like to keep my editor<->format integration intact. Could we use the latest (since it's arbitrary and easily update-able)? |
OpenThread uses:
I think it's important to pick a version and stick to it - different versions can have different output. I agree, the particular version chosen is arbitrary. |
Can I propose we use the current latest version, since we're here now? :) Oh, and please document how to install it :) |
By "current latest" are you proposing hot-off-the-presses (v11) or "latest available to package managers in common, stable OS distributions"? My gMac laptop ships with v7. Ubuntu 18.04 I believe defaults to v6.0 after So the benefits of choosing v6.0 would be:
|
d3956f9
to
e2ea981
Compare
Remove autogenerated file: src/include/BuildConfig.h
Ok. To address comments, this PR has been updated in two ways:
It appears from the diffs that the only files that needed style updates applied were new QR code, tests, and many of the headers. |
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.
Thanks @turon for dealing with the style change discussion :)
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.
Just one minor nit
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.
Some minor documentation issues to adjust.
As tools advance, it'd be nice to avail ourselves of the features and capabilities. I advocate:
Is this is a weird place for this discussion? |
…ges - MATTER-705 Merge in WMN_TOOLS/matter from feature/pre-commit-hook to silabs Squashed commit of the following: commit fdff3509f1e85d78ebb923f89d7f63d644848556 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Thu Sep 8 08:51:39 2022 -0400 Reverted pre-commit script, renamed run-all script commit 01c1ed82b6a5dfa11c7c2f186344be5f09b8bfd3 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Wed Sep 7 10:01:27 2022 -0400 Cleaned up; added comments/descriptions commit 6febf6cbe5a01bfae11eb7881286ea487ef6450a Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Tue Sep 6 14:22:50 2022 -0400 Added pre-commit SMG checker, modified existing pre-commit
…ges - MATTER-705 Merge in WMN_TOOLS/matter from feature/pre-commit-hook to silabs Squashed commit of the following: commit fdff3509f1e85d78ebb923f89d7f63d644848556 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Thu Sep 8 08:51:39 2022 -0400 Reverted pre-commit script, renamed run-all script commit 01c1ed82b6a5dfa11c7c2f186344be5f09b8bfd3 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Wed Sep 7 10:01:27 2022 -0400 Cleaned up; added comments/descriptions commit 6febf6cbe5a01bfae11eb7881286ea487ef6450a Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Tue Sep 6 14:22:50 2022 -0400 Added pre-commit SMG checker, modified existing pre-commit
…ded CSA changes - MATTER-705 Merge in WMN_TOOLS/matter from feature/pre-commit-hook to silabs Squashed commit of the following: commit fdff3509f1e85d78ebb923f89d7f63d644848556 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Thu Sep 8 08:51:39 2022 -0400 Reverted pre-commit script, renamed run-all script commit 01c1ed82b6a5dfa11c7c2f186344be5f09b8bfd3 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Wed Sep 7 10:01:27 2022 -0400 Cleaned up; added comments/descriptions commit 6febf6cbe5a01bfae11eb7881286ea487ef6450a Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Tue Sep 6 14:22:50 2022 -0400 Added pre-commit SMG checker, modified existing pre-commit
…ges - MATTER-705 Merge in WMN_TOOLS/matter from feature/pre-commit-hook to silabs Squashed commit of the following: commit fdff3509f1e85d78ebb923f89d7f63d644848556 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Thu Sep 8 08:51:39 2022 -0400 Reverted pre-commit script, renamed run-all script commit 01c1ed82b6a5dfa11c7c2f186344be5f09b8bfd3 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Wed Sep 7 10:01:27 2022 -0400 Cleaned up; added comments/descriptions commit 6febf6cbe5a01bfae11eb7881286ea487ef6450a Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Tue Sep 6 14:22:50 2022 -0400 Added pre-commit SMG checker, modified existing pre-commit
…ges - MATTER-705 Merge in WMN_TOOLS/matter from feature/pre-commit-hook to silabs Squashed commit of the following: commit fdff3509f1e85d78ebb923f89d7f63d644848556 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Thu Sep 8 08:51:39 2022 -0400 Reverted pre-commit script, renamed run-all script commit 01c1ed82b6a5dfa11c7c2f186344be5f09b8bfd3 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Wed Sep 7 10:01:27 2022 -0400 Cleaned up; added comments/descriptions commit 6febf6cbe5a01bfae11eb7881286ea487ef6450a Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Tue Sep 6 14:22:50 2022 -0400 Added pre-commit SMG checker, modified existing pre-commit
…ges - MATTER-705 Merge in WMN_TOOLS/matter from feature/pre-commit-hook to silabs Squashed commit of the following: commit fdff3509f1e85d78ebb923f89d7f63d644848556 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Thu Sep 8 08:51:39 2022 -0400 Reverted pre-commit script, renamed run-all script commit 01c1ed82b6a5dfa11c7c2f186344be5f09b8bfd3 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Wed Sep 7 10:01:27 2022 -0400 Cleaned up; added comments/descriptions commit 6febf6cbe5a01bfae11eb7881286ea487ef6450a Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Tue Sep 6 14:22:50 2022 -0400 Added pre-commit SMG checker, modified existing pre-commit
…ded CSA changes - MATTER-705 Merge in WMN_TOOLS/matter from feature/pre-commit-hook to silabs Squashed commit of the following: commit fdff3509f1e85d78ebb923f89d7f63d644848556 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Thu Sep 8 08:51:39 2022 -0400 Reverted pre-commit script, renamed run-all script commit 01c1ed82b6a5dfa11c7c2f186344be5f09b8bfd3 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Wed Sep 7 10:01:27 2022 -0400 Cleaned up; added comments/descriptions commit 6febf6cbe5a01bfae11eb7881286ea487ef6450a Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Tue Sep 6 14:22:50 2022 -0400 Added pre-commit SMG checker, modified existing pre-commit
…ded CSA changes - MATTER-705 Merge in WMN_TOOLS/matter from feature/pre-commit-hook to silabs Squashed commit of the following: commit fdff3509f1e85d78ebb923f89d7f63d644848556 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Thu Sep 8 08:51:39 2022 -0400 Reverted pre-commit script, renamed run-all script commit 01c1ed82b6a5dfa11c7c2f186344be5f09b8bfd3 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Wed Sep 7 10:01:27 2022 -0400 Cleaned up; added comments/descriptions commit 6febf6cbe5a01bfae11eb7881286ea487ef6450a Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Tue Sep 6 14:22:50 2022 -0400 Added pre-commit SMG checker, modified existing pre-commit
…ded CSA changes - MATTER-705 Merge in WMN_TOOLS/matter from feature/pre-commit-hook to silabs Squashed commit of the following: commit fdff3509f1e85d78ebb923f89d7f63d644848556 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Thu Sep 8 08:51:39 2022 -0400 Reverted pre-commit script, renamed run-all script commit 01c1ed82b6a5dfa11c7c2f186344be5f09b8bfd3 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Wed Sep 7 10:01:27 2022 -0400 Cleaned up; added comments/descriptions commit 6febf6cbe5a01bfae11eb7881286ea487ef6450a Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Tue Sep 6 14:22:50 2022 -0400 Added pre-commit SMG checker, modified existing pre-commit
…ded CSA changes - MATTER-705 Merge in WMN_TOOLS/matter from feature/pre-commit-hook to silabs Squashed commit of the following: commit fdff3509f1e85d78ebb923f89d7f63d644848556 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Thu Sep 8 08:51:39 2022 -0400 Reverted pre-commit script, renamed run-all script commit 01c1ed82b6a5dfa11c7c2f186344be5f09b8bfd3 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Wed Sep 7 10:01:27 2022 -0400 Cleaned up; added comments/descriptions commit 6febf6cbe5a01bfae11eb7881286ea487ef6450a Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Tue Sep 6 14:22:50 2022 -0400 Added pre-commit SMG checker, modified existing pre-commit
…ded CSA changes - MATTER-705 Merge in WMN_TOOLS/matter from feature/pre-commit-hook to silabs Squashed commit of the following: commit fdff3509f1e85d78ebb923f89d7f63d644848556 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Thu Sep 8 08:51:39 2022 -0400 Reverted pre-commit script, renamed run-all script commit 01c1ed82b6a5dfa11c7c2f186344be5f09b8bfd3 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Wed Sep 7 10:01:27 2022 -0400 Cleaned up; added comments/descriptions commit 6febf6cbe5a01bfae11eb7881286ea487ef6450a Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Tue Sep 6 14:22:50 2022 -0400 Added pre-commit SMG checker, modified existing pre-commit