Skip to content

Commit

Permalink
don't run deps anaylsis when source only
Browse files Browse the repository at this point in the history
Signed-off-by: Shawn Hurley <shawn@hurley.page>
  • Loading branch information
shawn-hurley committed Jul 9, 2024
1 parent 195b627 commit a77b132
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions cmd/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,17 @@ type Scope struct {

// AddOptions adds analyzer options.
func (r *Scope) AddOptions(options *command.Options, mode Mode) (err error) {
if !r.WithKnownLibs && mode.WithDeps {
options.Add(
"--dep-label-selector",
"!konveyor.io/dep-source=open-source")
// If withDeps is false, we are only every doing source analysis
// adding a dep label selector is strictly wrong in this situation
if mode.WithDeps {
// We want to filter out open source violations when we are not running
// with known libraries.
if !r.WithKnownLibs {
options.Add(
"--dep-label-selector",
"!konveyor.io/dep-source=open-source")
}

}
selector := r.incidentSelector()
if selector != "" {
Expand Down

0 comments on commit a77b132

Please sign in to comment.