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

Checkpatch and check_compliance.py disagree on spacing #81267

Open
SeppoTakalo opened this issue Nov 12, 2024 · 1 comment
Open

Checkpatch and check_compliance.py disagree on spacing #81267

SeppoTakalo opened this issue Nov 12, 2024 · 1 comment
Assignees
Labels
area: Coding Guidelines Coding guidelines and style bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@SeppoTakalo
Copy link
Collaborator

Describe the bug

Using checkpatch.pl to check your changes:

$ checkpatch.pl -G upstream/main..
...
689bfcc0cc5ef56dd4e407d533474606d53cb384:63: ERROR:SPACING: space required before the open brace '{'
#63: FILE: tests/net/lib/coap_client/src/main.c:69:
+		if (memcmp(last_token[i], &(uint8_t[8]){0, 0, 0, 0, 0, 0, 0, 0}, 8) == 0) {

And fixing that produces warning on another check tool

$ ./scripts/ci/check_compliance.py -c upstream/main..HEAD -m ClangFormat
...
You may want to run clang-format on this change:
-		if (memcmp(last_token[i], &(uint8_t[8]) {0, 0, 0, 0, 0, 0, 0, 0}, 8) == 0) {
+		if (memcmp(last_token[i], &(uint8_t[8]){0, 0, 0, 0, 0, 0, 0, 0}, 8) == 0) {

To Reproduce

  1. Create commit with a line above.
  2. Run checkpatch and check_compliance.pl

Expected behavior

I expect both tools to agree on styling as both are used in CI to verify PRs.

Impact

annoyance

@SeppoTakalo SeppoTakalo added the bug The issue is a bug, or the PR is fixing a bug label Nov 12, 2024
@mmahadevan108 mmahadevan108 added area: Coding Guidelines Coding guidelines and style priority: low Low impact/importance bug labels Nov 12, 2024
@mmahadevan108
Copy link
Collaborator

This is similar to #78214

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Coding Guidelines Coding guidelines and style bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

3 participants