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

Function do_exist

tools/checkimports.py:10–15  ·  view source on GitHub ↗
(file_name, lines, imported)

Source from the content-addressed store, hash-verified

8import itertools
9
10def do_exist(file_name, lines, imported):
11 if not any(not re.match(fr'using \w+::{imported};', line) and
12 re.search(fr'\b{imported}\b', line) for line in lines):
13 print(f'File "{file_name}" does not use "{imported}"')
14 return False
15 return True
16
17
18def is_valid(file_name):

Callers 1

is_validFunction · 0.85

Calls 3

matchMethod · 0.65
printFunction · 0.50
searchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…