Skip to content

Commit

Permalink
🐛 Handle custom rules for .net framework (#316)
Browse files Browse the repository at this point in the history
* 🐛 Handle custom rules for .net framework

Signed-off-by: David Zager <dzager@redhat.com>

* simplify path

Signed-off-by: David Zager <dzager@redhat.com>

---------

Signed-off-by: David Zager <dzager@redhat.com>
Signed-off-by: Cherry Picker <noreply@github.com>
  • Loading branch information
djzager authored and web-flow committed Aug 14, 2024
1 parent dd48d69 commit d902e89
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions cmd/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -2217,14 +2217,20 @@ func (a *analyzeCommand) analyzeDotnetFramework(ctx context.Context) error {
}

if a.enableDefaultRulesets {
args = append(args, fmt.Sprintf("--rules=%s/", "C:"+filepath.FromSlash(RulesetPath)))
args = append(args, fmt.Sprintf("--rules=C:%s", filepath.FromSlash(RulesetPath)))
}

if len(a.rules) > 0 {
for index, rule := range a.rules {
volumes[rule] = fmt.Sprintf("C:%v-%d", filepath.FromSlash(CustomRulePath), index)
ruleVols, err := a.getRulesVolumes()
if err != nil {
a.log.V(1).Error(err, "failed to get rule volumes for analysis")
return err
}
for key, value := range ruleVols {
volumes[key] = "C:" + filepath.FromSlash(value)
}
args = append(args, fmt.Sprintf("--rules=%s/", CustomRulePath))

args = append(args, fmt.Sprintf("--rules=C:%s", filepath.FromSlash(CustomRulePath)))
}

if a.jaegerEndpoint != "" {
Expand Down

0 comments on commit d902e89

Please sign in to comment.