MCPcopy Create free account
hub / github.com/apache/fory / scan_generated_files

Function scan_generated_files

compiler/fory_compiler/cli.py:69–87  ·  view source on GitHub ↗

Scan for generated files under root.

(root: Path, relative: bool)

Source from the content-addressed store, hash-verified

67
68
69def scan_generated_files(root: Path, relative: bool) -> List[Path]:
70 """Scan for generated files under root."""
71 matches: List[Path] = []
72 for dirpath, dirnames, filenames in os.walk(root):
73 dirnames[:] = [d for d in dirnames if not should_skip_dir(d)]
74 for filename in filenames:
75 file_path = Path(dirpath) / filename
76 if not file_path.is_file():
77 continue
78 if is_generated_file(file_path):
79 matches.append(file_path)
80 display_path = file_path
81 if relative:
82 try:
83 display_path = file_path.relative_to(root)
84 except ValueError:
85 pass
86 print(f" Generated: {display_path}")
87 return matches
88
89
90def resolve_imports(

Callers 1

cmd_scan_generatedFunction · 0.85

Calls 3

should_skip_dirFunction · 0.85
is_generated_fileFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected