Skip to content

Commit 8672c42

Browse files
committed
implement NPM
Signed-off-by: Jefferson <jefferson.rios.caro@gmail.com>
1 parent 163c071 commit 8672c42

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

dep_checker/npm_audit.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,24 @@ def __init__(self, repo_path: Path, timeout: int = 300):
2424
self.timeout = timeout
2525

2626
def find_package_json_files(self) -> List[Path]:
27-
"""Find all package.json files in the repository"""
27+
"""Find all package.json files in the deps/ folder only"""
2828
package_json_files = []
2929
try:
30-
# Use pathlib to recursively find package.json files
31-
for package_json in self.repo_path.rglob("package.json"):
30+
# Only search within the deps/ folder
31+
deps_path = self.repo_path / "deps"
32+
if not deps_path.exists():
33+
logger.warning(f"deps/ folder not found at {deps_path}")
34+
return []
35+
36+
# Use pathlib to recursively find package.json files in deps/ folder
37+
for package_json in deps_path.rglob("package.json"):
3238
# Skip node_modules directories
3339
if "node_modules" not in str(package_json):
3440
package_json_files.append(package_json)
35-
logger.info(f"Found {len(package_json_files)} package.json files")
41+
logger.info(f"Found {len(package_json_files)} package.json files in deps/ folder")
3642
return package_json_files
3743
except Exception as e:
38-
logger.error(f"Error finding package.json files: {e}")
44+
logger.error(f"Error finding package.json files in deps/ folder: {e}")
3945
return []
4046

4147
def run_npm_install(self, package_dir: Path) -> bool:

0 commit comments

Comments
 (0)