https://gcc.gnu.org/g:d9199569ce579a72d7e6fc88f9235e68778c06cd
commit r17-455-gd9199569ce579a72d7e6fc88f9235e68778c06cd Author: Andrew Pinski <[email protected]> Date: Mon May 11 14:34:58 2026 -0700 contrib: Fix check_GNU_style.py for some .opt issues [PR125275] I noticed while reviewing a patch check_GNU_style.py would fail for the .opt files in a few ways. First greater than 80 columns is expected. Second is the space after the "function". Both of these are not useful for .opt so let's ignore then here. PR other/125275 contrib/ChangeLog: * check_GNU_style_lib.py (LineLengthCheck.check): Ignore filenames that end with .opt. (FunctionParenthesisCheck.check): Likewise. Signed-off-by: Andrew Pinski <[email protected]> Diff: --- contrib/check_GNU_style_lib.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/check_GNU_style_lib.py b/contrib/check_GNU_style_lib.py index bcfe459b4df4..a7c4e2b0bd55 100755 --- a/contrib/check_GNU_style_lib.py +++ b/contrib/check_GNU_style_lib.py @@ -82,7 +82,7 @@ class LineLengthCheck: def check(self, filename, lineno, line): line_expanded = line.replace('\t', self.expanded_tab) - if len(line_expanded) > self.limit: + if not filename.endswith(".opt") and len(line_expanded) > self.limit: return CheckError(filename, lineno, line_expanded[:self.limit] + error_string(line_expanded[self.limit:]), @@ -167,6 +167,9 @@ class FunctionParenthesisCheck: self.re = re.compile(r'\w(\s{2,})?(\()') def check(self, filename, lineno, line): + if filename.endswith(".opt"): + return None + if '#define' in line: return None
