Skip to content

Commit 01d9083

Browse files
committed
Update code comments
1 parent 2df156e commit 01d9083

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

src/datacustomcode/scan.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -258,24 +258,20 @@ def visit_ImportFrom(self, node: ast.ImportFrom) -> None:
258258

259259

260260
def scan_file_for_imports(file_path: str) -> Set[str]:
261-
"""Scan a Python file for external package imports.
262-
263-
Excludes local modules (Python files in the same directory).
264-
"""
261+
"""Scan a Python file for external package imports."""
265262
with open(file_path, "r") as f:
266263
code = f.read()
267264
tree = ast.parse(code)
268265
visitor = ImportVisitor()
269266
visitor.visit(tree)
270267

271-
# Filter out local modules (files in the same directory)
268+
# Filter out local modules
272269
file_dir = os.path.dirname(file_path)
273270
filtered_imports = set()
274271
for package in visitor.imports:
275-
# Check if this is a local module (a .py file exists in the same directory)
272+
# Check if a .py file exists in the same directory
276273
local_module_path = os.path.join(file_dir, f"{package}.py")
277274
if not os.path.exists(local_module_path):
278-
# Not a local module, keep it in the imports
279275
filtered_imports.add(package)
280276

281277
return filtered_imports

0 commit comments

Comments
 (0)