fix: pip args & manifest files handling (#41)

* fix: pip args & manifest files handling

* chore: add pflag dependency

* chore: word fixes

* fix: multiple refs for suspicious packages

* refactor: introduce block config

* fix: makefile for windows build

* test: add test cases for manifest based installation

* refactor: Makefile

* refactor: remove .exe for windows build
This commit is contained in:
Sahil Bansal
2025-06-24 12:44:12 +05:30
committed by GitHub
parent b64f158654
commit 3f85282935
8 changed files with 179 additions and 221 deletions
+8 -2
View File
@@ -12,6 +12,7 @@ import (
type ExtractorConfig struct {
ExtractorPackageManager PackageManagerName
ScanDir string
ManifestFiles []string
}
type extractor struct {
@@ -21,7 +22,8 @@ type extractor struct {
func NewDefaultExtractorConfig() *ExtractorConfig {
return &ExtractorConfig{
ScanDir: ".",
ScanDir: ".",
ManifestFiles: []string{},
}
}
@@ -36,7 +38,11 @@ func (e *extractor) ExtractManifest() ([]*packagev1.PackageVersion, error) {
packagesToAnalyze := []*packagev1.PackageVersion{}
// Get the list of lockfiles to check based on ecosystem
filesToCheck := e.getFilesToCheck()
filesToCheck := e.Config.ManifestFiles
if len(filesToCheck) == 0 {
filesToCheck = e.getFilesToCheck()
}
for _, filename := range filesToCheck {
filePath := filepath.Join(e.Config.ScanDir, filename)