Skip to content

Commit

Permalink
don't use full file paths for violations
Browse files Browse the repository at this point in the history
Signed-off-by: Emily McMullan <emcmulla@redhat.com>
  • Loading branch information
eemcmullan committed Mar 22, 2024
1 parent 1ff278b commit fe73801
Show file tree
Hide file tree
Showing 5 changed files with 303 additions and 260 deletions.
28 changes: 17 additions & 11 deletions cmd/analyzer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,13 @@ func AnalysisCmd() *cobra.Command {
os.Exit(1)
}

engineCtx, engineSpan := tracing.StartNewSpan(ctx, "rule-engine")
//start up the rule eng
eng := engine.CreateRuleEngine(engineCtx,
10,
log,
engine.WithIncidentLimit(limitIncidents),
engine.WithCodeSnipLimit(limitCodeSnips),
engine.WithContextLines(contextLines),
engine.WithIncidentSelector(incidentSelector),
)
providers := map[string]provider.InternalProviderClient{}

providerLocations := []string{}
for _, config := range configs {
config.ContextLines = contextLines
for _, ind := range config.InitConfig {
providerLocations = append(providerLocations, ind.Location)
}
// IF analsyis mode is set from the CLI, then we will override this for each init config
if analysisMode != "" {
inits := []provider.InitConfig{}
Expand All @@ -163,6 +156,19 @@ func AnalysisCmd() *cobra.Command {
}
}
}

engineCtx, engineSpan := tracing.StartNewSpan(ctx, "rule-engine")
//start up the rule eng
eng := engine.CreateRuleEngine(engineCtx,
10,
log,
engine.WithIncidentLimit(limitIncidents),
engine.WithCodeSnipLimit(limitCodeSnips),
engine.WithContextLines(contextLines),
engine.WithIncidentSelector(incidentSelector),
engine.WithLocationPrefixes(providerLocations),
)

if getOpenAPISpec != "" {
sc := createOpenAPISchema(providers, log)
b, err := json.Marshal(sc)
Expand Down
Loading

0 comments on commit fe73801

Please sign in to comment.