Lines Matching refs:filepath

56     def normalize_path(filepath):
57 """Normalize ``filepath`` with / as the directory separator."""
58 filepath = os.path.normpath(filepath)
64 return '/'.join(filepath.split(seps))
66 def should_check_file(self, filepath):
73 if filepath.endswith(files_exemption):
76 re.match(self.path_exemptions, self.normalize_path(filepath)):
80 def check_file_for_issue(self, filepath):
87 def record_issue(self, filepath, line_number):
89 if filepath not in self.files_with_issues.keys():
90 self.files_with_issues[filepath] = []
91 self.files_with_issues[filepath].append(line_number)
129 def issue_with_line(self, line, filepath, line_number):
136 def check_file_line(self, filepath, line, line_number):
137 if self.issue_with_line(line, filepath, line_number):
138 self.record_issue(filepath, line_number)
140 def check_file_for_issue(self, filepath):
145 with open(filepath, "rb") as f:
147 self.check_file_line(filepath, line, i + 1)
150 def is_windows_file(filepath):
151 _root, ext = os.path.splitext(filepath)
178 def is_valid_shebang(self, first_line, filepath):
185 if not filepath.endswith('.' + self._extensions[interpreter]):
189 def check_file_for_issue(self, filepath):
190 is_executable = os.access(filepath, os.X_OK)
191 with open(filepath, "rb") as f:
196 self.files_with_issues[filepath] = None
197 elif not self.is_valid_shebang(first_line, filepath):
198 self.files_with_issues[filepath] = [1]
201 self.files_with_issues[filepath] = None
212 def check_file_for_issue(self, filepath):
213 with open(filepath, "rb") as f:
222 self.files_with_issues[filepath] = None
234 def check_file_for_issue(self, filepath):
235 with open(filepath, "rb") as f:
237 self.files_with_issues[filepath] = None
285 def should_check_file(self, filepath):
286 if not super().should_check_file(filepath):
288 return not is_windows_file(filepath)
299 def should_check_file(self, filepath):
300 if not super().should_check_file(filepath):
302 return is_windows_file(filepath)
410 def issue_with_line(self, line, filepath, line_number):
416 if filepath.endswith(THIS_FILE_BASE_NAME) and \
507 for filepath in self.collect_files():
508 if issue_to_check.should_check_file(filepath):
509 issue_to_check.check_file_for_issue(filepath)