util: Ignore line length check for #include pragma in C/C++ files (#134)
The length of the path of #include pragmas can be more than 79-character long. The length of the path of a #include pragma can be outside of user's control.
This commit is contained in:
@@ -424,7 +424,11 @@ class LineLength(LineVerifier):
|
||||
test_name = "line length"
|
||||
opt_name = "length"
|
||||
|
||||
def check_line(self, line, **kwargs):
|
||||
def check_line(self, line, language, **kwargs):
|
||||
# Ignore line length check for include pragmas of C/C++.
|
||||
if language in {"C", "C++"}:
|
||||
if line.startswith("#include"):
|
||||
return True
|
||||
return style.normalized_len(line) <= 79
|
||||
|
||||
def fix(self, filename, regions=all_regions, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user