Pass line number to issue_with_line
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
diff --git a/tests/scripts/check_files.py b/tests/scripts/check_files.py
index e1c6478..03400ab 100755
--- a/tests/scripts/check_files.py
+++ b/tests/scripts/check_files.py
@@ -136,7 +136,7 @@
# Exclude binary files.
path_exemptions = BINARY_FILE_PATH_RE
- def issue_with_line(self, line, filepath):
+ def issue_with_line(self, line, filepath, line_number):
"""Check the specified line for the issue that this class is for.
Subclasses must implement this method.
@@ -144,7 +144,7 @@
raise NotImplementedError
def check_file_line(self, filepath, line, line_number):
- if self.issue_with_line(line, filepath):
+ if self.issue_with_line(line, filepath, line_number):
self.record_issue(filepath, line_number)
def check_file_for_issue(self, filepath):
@@ -273,7 +273,7 @@
return False
return not is_windows_file(filepath)
- def issue_with_line(self, line, _filepath):
+ def issue_with_line(self, line, _filepath, _line_number):
return b"\r" in line
@@ -287,7 +287,7 @@
return False
return is_windows_file(filepath)
- def issue_with_line(self, line, _filepath):
+ def issue_with_line(self, line, _filepath, _line_number):
return not line.endswith(b"\r\n") or b"\r" in line[:-2]
@@ -297,7 +297,7 @@
heading = "Trailing whitespace:"
suffix_exemptions = frozenset([".dsp", ".md"])
- def issue_with_line(self, line, _filepath):
+ def issue_with_line(self, line, _filepath, _line_number):
return line.rstrip(b"\r\n") != line.rstrip()
@@ -313,7 +313,7 @@
"/generate_visualc_files.pl",
])
- def issue_with_line(self, line, _filepath):
+ def issue_with_line(self, line, _filepath, _line_number):
return b"\t" in line
@@ -323,7 +323,7 @@
heading = "Merge artifact:"
- def issue_with_line(self, line, _filepath):
+ def issue_with_line(self, line, _filepath, _line_number):
# Detect leftover git conflict markers.
if line.startswith(b'<<<<<<< ') or line.startswith(b'>>>>>>> '):
return True