Runs processor only on affected files.
(self, files)
| 257 | return self.ProcessFiles(all_files) |
| 258 | |
| 259 | def RunOnFiles(self, files): |
| 260 | """Runs processor only on affected files.""" |
| 261 | |
| 262 | # Helper for getting directory pieces. |
| 263 | dirs = lambda f: dirname(f).split(os.sep) |
| 264 | |
| 265 | # Path offsets where to look (to be in sync with RunOnPath). |
| 266 | # Normalize '.' to check for it with str.startswith. |
| 267 | search_paths = [('' if p == '.' else p) for p in self.GetPathsToSearch()] |
| 268 | |
| 269 | all_files = [ |
| 270 | f.AbsoluteLocalPath() |
| 271 | for f in files |
| 272 | if (not self.IgnoreFile(f.LocalPath()) and |
| 273 | self.IsRelevant(f.LocalPath()) and |
| 274 | all(not self.IgnoreDir(d) for d in dirs(f.LocalPath())) and |
| 275 | any(map(f.LocalPath().startswith, search_paths))) |
| 276 | ] |
| 277 | |
| 278 | return self.ProcessFiles(all_files) |
| 279 | |
| 280 | def IgnoreDir(self, name): |
| 281 | return (name.startswith('.') or |
no test coverage detected