Skip to content

Commit

Permalink
✨ Cherry-pick - Don't use full file paths for violations (#558)
Browse files Browse the repository at this point in the history
  • Loading branch information
eemcmullan authored Apr 2, 2024
1 parent d98d847 commit b0c19f9
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 106 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/demo-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
with:
fetch-depth: 0
repository: konveyor/tackle2-addon-analyzer
ref: main
ref: release-0.3
path: tackle2-addon-analyzer

- name: Build addon and save image
Expand All @@ -56,3 +56,5 @@ jobs:
uses: konveyor/ci/.github/workflows/global-ci.yml@main
with:
component_name: tackle2-addon-analyzer
api_tests_ref: release-0.3

25 changes: 14 additions & 11 deletions cmd/analyzer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,20 +137,13 @@ func main() {
os.Exit(1)
}

//start up the rule eng
eng := engine.CreateRuleEngine(ctx,
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 @@ -173,6 +166,16 @@ func main() {
}
}
}
//start up the rule eng
eng := engine.CreateRuleEngine(ctx,
10,
log,
engine.WithIncidentLimit(limitIncidents),
engine.WithCodeSnipLimit(limitCodeSnips),
engine.WithContextLines(contextLines),
engine.WithIncidentSelector(incidentSelector),
engine.WithLocationPrefixes(providerLocations),
)

parser := parser.RuleParser{
ProviderNameToClient: providers,
Expand Down
Loading

0 comments on commit b0c19f9

Please sign in to comment.