Lines Matching refs:line

8 including incorrect file permissions, presence of tabs, non-Unix line endings,
120 """Base class for line-by-line issue tracking.
122 To implement a checker that processes files line by line, inherit from
129 def issue_with_line(self, line, filepath, line_number):
130 """Check the specified line for the issue that this class is for.
136 def check_file_line(self, filepath, line, line_number):
137 if self.issue_with_line(line, filepath, line_number):
146 for i, line in enumerate(iter(f.readline, b"")):
147 self.check_file_line(filepath, line, i + 1)
156 """Track files with a bad, missing or extraneous shebang line.
158 Executable scripts must start with a valid shebang (#!) line.
161 heading = "Invalid shebang line:"
205 """Track files that end with an incomplete line
206 (no newline character at the end of the last line)."""
248 # line breaks, "basic" no-break space and soft hyphen). In particular,
256 '\t\n\r -~', # ASCII (tabs and line endings are checked separately)
268 def issue_with_line(self, line, _filepath, line_number):
270 text = line.decode('utf-8')
281 """Track files with non-Unix line endings (i.e. files with CR)."""
283 heading = "Non-Unix line endings:"
290 def issue_with_line(self, line, _filepath, _line_number):
291 return b"\r" in line
295 """Track files with non-Windows line endings (i.e. CR or LF not in CRLF)."""
297 heading = "Non-Windows line endings:"
304 def issue_with_line(self, line, _filepath, _line_number):
305 return not line.endswith(b"\r\n") or b"\r" in line[:-2]
314 def issue_with_line(self, line, _filepath, _line_number):
315 return line.rstrip(b"\r\n") != line.rstrip()
332 def issue_with_line(self, line, _filepath, _line_number):
333 return b"\t" in line
342 def issue_with_line(self, line, _filepath, _line_number):
344 if line.startswith(b'<<<<<<< ') or line.startswith(b'>>>>>>> '):
346 if line.startswith(b'||||||| '): # from merge.conflictStyle=diff3
348 if line.rstrip(b'\r\n') == b'=======' and \
410 def issue_with_line(self, line, filepath, line_number):
424 m = self.COPYRIGHT_RE.match(line)
426 self.problem = 'Invalid copyright line'
429 m = self.SPDX_RE.match(line)
441 m = self.LICENSE_MENTION_RE.match(line)