Skip to content

tools/nxstyle: check alignment of statements without a leading keyword - #19934

Draft
raiden00pl wants to merge 3 commits into
apache:masterfrom
raiden00pl:nxstyle_fixes_pr4
Draft

tools/nxstyle: check alignment of statements without a leading keyword#19934
raiden00pl wants to merge 3 commits into
apache:masterfrom
raiden00pl:nxstyle_fixes_pr4

Conversation

@raiden00pl

Copy link
Copy Markdown
Member

Summary

Only lines beginning with a C keyword were checked, so an assignment or a call could sit at any column.

Impact

nuttx coding standard compatibility

Testing

detect wrong alignment like below:

int demo(int a, int b)
{
  int x;

  x = a + b;
    x = x * 2;                                         // <<< not detected
  printf("%d\n", x);
      printf("hello\n");                               // <<< not detecetd
  if (x > 0)
    {
      x--;
        x++;                                           // << not detected
    }

  return x;
}

Braces were only tested against a multiple of the indentation unit, so
one at the wrong level still passed.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
A residue modulo four expresses neither the indentation unit nor the
alignment of case logic, and all of it was disabled from the first
switch to the end of the enclosing function.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
Only lines beginning with a C keyword were checked, so an assignment or
a call could sit at any column.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
@github-actions github-actions Bot added Area: Tooling Size: M The size of the change in this PR is medium labels Aug 22, 2026
@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Tooling Size: M The size of the change in this PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant