-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
updates to checkpatch and clang-format configuration #23823
Conversation
All checks are passing now. Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
This takes the linux diffs between a8c964eacb21288b2dbfa9d80cee5968a3b8fb21 and 16fbf79b0f83bc752cee8589279f1ebfe57b3b6e and applies them to the Zephyr copy. Three changes did not apply cleanly: * linux added a comment to the line that enables C99 comments; Zephyr disallows them. * linux uses vendor-prefixes.yaml; zephyr uses the older .txt file * manual addition of colon in a check before BRACKET_SPACE error Signed-off-by: Peter Bigot <[email protected]>
Linux uses for_each in macros that produce loops; Zephyr uses FOR_EACH. Update the corresponding checks to match Zephyr's spelling. Signed-off-by: Peter Bigot <[email protected]>
Correct the shell fragment to use the spelling Zephyr uses, and re-run it to update the list. Signed-off-by: Peter Bigot <[email protected]>
aef6110
to
c5b906f
Compare
@pabigot What version of clang-format should be used? I am asking because of lines like this:
|
@chrta I have no idea. Those lines are unchanged from the current Linux configuration. It appears 11 is latest; my OS distribution gave me 9. Since it doesn't seem like Linux actually uses this (since it creates code that doesn't pass checkpatch) I don't think it's useful, and I'm not planning to try to create a configuration that matches Zephyr style, but since it's already in tree it seemed worth getting it updated. |
This patch introduced a SPDX license identifier-related noise, unless we are now enforcing Linux-style license identifier placement (i.e. in the first line):
|
Basic cleanup preparatory to addressing #21392 (comment), specifically to update checkpatch to be closer to current Linux, and verifying
.clang-format
is consistent with Zephyr needs.FWIW, our
.clang-format
and LInux differ only in the ForEachMacros list. clang-format transforms those to add a space after the macro name, which gets diagnosed as a style error by checkpatch. The Linux clang-format also makes changes that are rejected by Linux checkpatch (ForEachMacros and other whitespace diagnostics). So it's not clear that clang-format is actually used by Linux.