Skip to content

Commit

Permalink
✨ Don't use full file paths for violations (#548)
Browse files Browse the repository at this point in the history
Closes #322

---------

Signed-off-by: Emily McMullan <[email protected]>
  • Loading branch information
eemcmullan authored Mar 29, 2024
1 parent 34192a2 commit bd8295e
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 103 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 bd8295e

Please sign in to comment.