Andrew Pinski <[email protected]> writes: > 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. > > contrib/ChangeLog: > * check_GNU_style_lib.py (LineLengthCheck.check): Ignore > filenames that end with .opt. > (FunctionParenthesisCheck.check): Likewise.
Looks right to me (and obvious). > > Signed-off-by: Andrew Pinski <[email protected]> > --- > 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 bcfe459b4df..2087bbef977 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
signature.asc
Description: PGP signature
