MCPcopy Create free account
hub / github.com/ChromeDevTools/devtools-frontend / _GetAffectedFiles

Function _GetAffectedFiles

PRESUBMIT.py:88–105  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

86
87
88def _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
108def _CheckWithNodeScript(input_api,

Callers 6

_GetFilesToLintFunction · 0.85
CheckExperimentTelemetryFunction · 0.85
CheckDevToolsLintFunction · 0.85
CheckGeneratedFilesFunction · 0.85
CheckL10nStringsFunction · 0.85
CheckNodeModulesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected