Lines Matching refs:filepath
22 that reads all the .java files and builds a mapping of class name -> filepath.
23 In CheckFile, we convert each import statement into a real filepath, and check
33 _classmap: dict of fully-qualified Java class name -> filepath
52 def _GetClassFullName(self, filepath):
54 if not os.path.isfile(filepath):
56 with codecs.open(filepath, encoding='utf-8') as f:
57 short_class_name, _ = os.path.splitext(os.path.basename(filepath))
104 for filepath, changed_lines in (added_imports or []):
105 if not self.ShouldCheck(filepath):
107 full_class_name = self._GetClassFullName(filepath)
116 def _PrescanFile(self, filepath, added_classset):
118 print('Prescanning: ' + filepath)
119 full_class_name = self._GetClassFullName(filepath)
123 if not any(re.match(i, filepath) for i in
126 print(' ' + filepath)
132 self._classmap[full_class_name] = filepath
134 self._classmap[full_class_name] = filepath
136 print('WARNING: no package definition found in %s' % filepath)
138 def CheckLine(self, rules, line, filepath, fail_on_temp_allow=False):
159 rule = rules.RuleApplyingTo(import_path, filepath)
165 def CheckFile(self, rules, filepath):
167 print('Checking: ' + filepath)
169 dependee_status = results.DependeeStatus(filepath)
170 with codecs.open(filepath, encoding='utf-8') as f:
172 is_import, violation = self.CheckLine(rules, line, filepath)
182 def IsJavaFile(filepath):
186 return os.path.splitext(filepath)[1] in JavaChecker.EXTENSIONS