Lines Matching refs:filepath
87 def normalize_path(filepath): argument
89 filepath = os.path.normpath(filepath)
95 return '/'.join(filepath.split(seps))
97 def should_check_file(self, filepath): argument
104 if filepath.endswith(files_exemption):
107 re.match(self.path_exemptions, self.normalize_path(filepath)):
111 def check_file_for_issue(self, filepath): argument
118 def record_issue(self, filepath, line_number): argument
120 if filepath not in self.files_with_issues.keys():
121 self.files_with_issues[filepath] = []
122 self.files_with_issues[filepath].append(line_number)
158 def issue_with_line(self, line, filepath): argument
165 def check_file_line(self, filepath, line, line_number): argument
166 if self.issue_with_line(line, filepath):
167 self.record_issue(filepath, line_number)
169 def check_file_for_issue(self, filepath): argument
174 with open(filepath, "rb") as f:
176 self.check_file_line(filepath, line, i + 1)
179 def is_windows_file(filepath): argument
180 _root, ext = os.path.splitext(filepath)
191 def check_file_for_issue(self, filepath): argument
192 is_executable = os.access(filepath, os.X_OK)
193 should_be_executable = filepath.endswith((".sh", ".pl", ".py"))
195 self.files_with_issues[filepath] = None
206 def check_file_for_issue(self, filepath): argument
207 with open(filepath, "rb") as f:
216 self.files_with_issues[filepath] = None
228 def check_file_for_issue(self, filepath): argument
229 with open(filepath, "rb") as f:
231 self.files_with_issues[filepath] = None
239 def should_check_file(self, filepath): argument
240 if not super().should_check_file(filepath):
242 return not is_windows_file(filepath)
253 def should_check_file(self, filepath): argument
254 if not super().should_check_file(filepath):
256 return is_windows_file(filepath)
354 for filepath in self.collect_files():
355 if issue_to_check.should_check_file(filepath):
356 issue_to_check.check_file_for_issue(filepath)