On Thu, Oct 24, 2024 at 8:24 PM Paul Moore <paul@xxxxxxxxxxxxxx> wrote: > > Update the astyle arguments in tools/check-syntax to work with modern > version of astyle. > > It is worth mentioning that astyle v3.6.3 appears to have a problem > with aligning/indenting continuation lines, preferring blind > indentation over alignment. > > Signed-off-by: Paul Moore <paul@xxxxxxxxxxxxxx> > --- > tools/check-syntax | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/tools/check-syntax b/tools/check-syntax > index 2115a7960dd5..2775eb46c6c4 100755 > --- a/tools/check-syntax > +++ b/tools/check-syntax > @@ -57,10 +57,9 @@ function tool_c_style() { > astyle --options=none --lineend=linux --mode=c \ > --style=linux \ > --indent=force-tab=8 \ > - --indent-preprocessor \ > --indent-col1-comments \ > --min-conditional-indent=0 \ > - --max-instatement-indent=80 \ > + --max-continuation-indent=80 \ > --pad-oper \ > --align-pointer=name \ > --align-reference=name \ > -- > 2.47.0 > > Thanks! I applied these with some changes: 1. I dropped patch 2 because I don't like the idea of filtering out known bad versions. 2. I updated patch 3 with what astyle 3.6.6 enforces (this version is now in Fedora 41 and it finally doesn't have buggy behavior with the testsuite's inputs). The style-check job now passes successfully. https://github.com/SELinuxProject/selinux-testsuite/commit/0f3dec2ab35e8739bb31bab8e6fcae51010c557c https://github.com/SELinuxProject/selinux-testsuite/commit/68ff0417fd8ac0e5c9c5897a31dd3c7d17201306 -- Ondrej Mosnacek Senior Software Engineer, Linux Security - SELinux kernel Red Hat, Inc.