Return absolute file paths of affected files (not due to an excluded action) under a parent directory with an accepted file ending.
(input_api, parent_directories, excluded_actions,
accepted_endings)
| 86 | |
| 87 | |
| 88 | def _GetAffectedFiles(input_api, parent_directories, excluded_actions, |
| 89 | accepted_endings): |
| 90 | """Return absolute file paths of affected files (not due to an excluded action) |
| 91 | under a parent directory with an accepted file ending. |
| 92 | """ |
| 93 | local_paths = [ |
| 94 | f.AbsoluteLocalPath() for f in input_api.AffectedFiles() |
| 95 | if all(f.Action() != action for action in excluded_actions) |
| 96 | ] |
| 97 | affected_files = [ |
| 98 | file_name for file_name in local_paths |
| 99 | if any(parent_directory in file_name |
| 100 | for parent_directory in parent_directories) and ( |
| 101 | len(accepted_endings) == 0 or any( |
| 102 | file_name.endswith(accepted_ending) |
| 103 | for accepted_ending in accepted_endings)) |
| 104 | ] |
| 105 | return affected_files |
| 106 | |
| 107 | |
| 108 | def _CheckWithNodeScript(input_api, |
no outgoing calls
no test coverage detected