MCPcopy Index your code
hub / github.com/nodejs/node / ImpactedFile

Class ImpactedFile

deps/v8/PRESUBMIT.py:220–236  ·  view source on GitHub ↗

Duck type version of AffectedFile needed to check files under directories where a DEPS file changed. Extend the interface along the line of AffectedFile if you need it for other checks.

Source from the content-addressed store, hash-verified

218 return result
219
220 class ImpactedFile(object):
221 """Duck type version of AffectedFile needed to check files under directories
222 where a DEPS file changed. Extend the interface along the line of
223 AffectedFile if you need it for other checks."""
224
225 def __init__(self, path):
226 self._path = path
227
228 def LocalPath(self):
229 path = self._path.replace(os.sep, '/')
230 return os.path.normpath(path)
231
232 def ChangedContents(self):
233 with open(self._path) as f:
234 # TODO(liviurau): read only '#include' lines
235 lines = f.readlines()
236 return enumerate(lines, start=1)
237
238 def _FilterDuplicates(impacted_files, affected_files):
239 """"We include all impacted files but exclude affected files that are also

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…