Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 skip windup-shim if .net framework analysis #299

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions cmd/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,6 @@ func NewAnalyzeCmd(log logr.Logger) *cobra.Command {
if analyzeCmd.providersMap == nil {
analyzeCmd.providersMap = make(map[string]ProviderInit)
}
xmlOutputDir, err := analyzeCmd.ConvertXML(cmd.Context())
if err != nil {
log.Error(err, "failed to convert xml rules")
return err
}
languages, err := recognizer.Analyze(analyzeCmd.input)
if err != nil {
log.Error(err, "Failed to determine languages for input")
Expand All @@ -221,17 +216,6 @@ func NewAnalyzeCmd(log logr.Logger) *cobra.Command {
log.Error(err, "failed to set provider info")
return err
}
// alizer does not detect certain files such as xml
// in this case we need to run only the analyzer to use builtin provider
if len(foundProviders) == 0 {
analyzeCmd.needsBuiltin = true
err = analyzeCmd.RunAnalysis(cmd.Context(), xmlOutputDir, analyzeCmd.input)
if err != nil {
log.Error(err, "failed to run analysis")
return err
}
return nil
}
err = analyzeCmd.validateProviders(foundProviders)
if err != nil {
return err
Expand All @@ -240,6 +224,18 @@ func NewAnalyzeCmd(log logr.Logger) *cobra.Command {
if len(foundProviders) == 1 && foundProviders[0] == dotnetFrameworkProvider {
return analyzeCmd.analyzeDotnetFramework(cmd.Context())
}
xmlOutputDir, err := analyzeCmd.ConvertXML(cmd.Context())
if err != nil {
log.Error(err, "failed to convert xml rules")
return err
}
// alizer does not detect certain files such as xml
// in this case we need to run only the analyzer to use builtin provider
if len(foundProviders) == 0 {
analyzeCmd.needsBuiltin = true
return analyzeCmd.RunAnalysis(cmd.Context(), xmlOutputDir, analyzeCmd.input)
}

err = analyzeCmd.setProviderInitInfo(foundProviders)
if err != nil {
log.Error(err, "failed to set provider init info")
Expand Down
Loading