• Home
  • Raw
  • Download

Lines Matching refs:filepath

55     def normalize_path(filepath):  argument
57 filepath = os.path.normpath(filepath)
63 return '/'.join(filepath.split(seps))
65 def should_check_file(self, filepath): argument
72 if filepath.endswith(files_exemption):
75 re.match(self.path_exemptions, self.normalize_path(filepath)):
79 def check_file_for_issue(self, filepath): argument
86 def record_issue(self, filepath, line_number): argument
88 if filepath not in self.files_with_issues.keys():
89 self.files_with_issues[filepath] = []
90 self.files_with_issues[filepath].append(line_number)
127 def issue_with_line(self, line, filepath, line_number): argument
134 def check_file_line(self, filepath, line, line_number): argument
135 if self.issue_with_line(line, filepath, line_number):
136 self.record_issue(filepath, line_number)
138 def check_file_for_issue(self, filepath): argument
143 with open(filepath, "rb") as f:
145 self.check_file_line(filepath, line, i + 1)
148 def is_windows_file(filepath): argument
149 _root, ext = os.path.splitext(filepath)
164 def check_file_for_issue(self, filepath): argument
165 is_executable = os.access(filepath, os.X_OK)
166 should_be_executable = filepath.endswith((".sh", ".pl"))
168 self.files_with_issues[filepath] = None
192 def is_valid_shebang(self, first_line, filepath): argument
199 if not filepath.endswith('.' + self._extensions[interpreter]):
203 def check_file_for_issue(self, filepath): argument
204 is_executable = os.access(filepath, os.X_OK)
205 with open(filepath, "rb") as f:
210 self.files_with_issues[filepath] = None
211 elif not self.is_valid_shebang(first_line, filepath):
212 self.files_with_issues[filepath] = [1]
215 self.files_with_issues[filepath] = None
226 def check_file_for_issue(self, filepath): argument
227 with open(filepath, "rb") as f:
236 self.files_with_issues[filepath] = None
248 def check_file_for_issue(self, filepath): argument
249 with open(filepath, "rb") as f:
251 self.files_with_issues[filepath] = None
299 def should_check_file(self, filepath): argument
300 if not super().should_check_file(filepath):
302 return not is_windows_file(filepath)
313 def should_check_file(self, filepath): argument
314 if not super().should_check_file(filepath):
316 return is_windows_file(filepath)
412 for filepath in self.collect_files():
413 if issue_to_check.should_check_file(filepath):
414 issue_to_check.check_file_for_issue(filepath)