Skip to content
Merged
Changes from 2 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
2 changes: 1 addition & 1 deletion cmd/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ func checkIfConfigExistsAndIsNeeded(toolName string, cliLocalMode bool) error {
if _, err := os.Stat(toolConfigPath); os.IsNotExist(err) {
// Config file does not exist - create it if we have the means to do so
if (!cliLocalMode && initFlags.ApiToken != "") || cliLocalMode {
fmt.Printf("Creating new config file for tool %s\n", toolName)
logger.Info(fmt.Sprintf("Creating new config file for tool %s\n", toolName))
Comment thread
heliocodacy marked this conversation as resolved.
Outdated
if err := configsetup.CreateToolConfigurationFile(toolName, initFlags); err != nil {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Issue] Ensure logger is non-nil and properly configured in the code paths that hit this branch (CLI local mode and non-local with API token). If logger can be nil in tests or early init, guard the call or initialize a no-op logger to avoid runtime panics.

Medium risk | Medium confidence

return fmt.Errorf("failed to create config file for tool %s: %w", toolName, err)
Comment on lines 319 to 321
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] You removed the fmt.Printf("Creating new config file for tool %s\n", toolName) line. If the intent is to silence standard output, prefer emitting the same message via the configured logging facility (e.g. logger.Info(...)) so users still get feedback when running with standard verbosity. If silent behavior is desired, add a brief comment explaining why the user-facing notification was removed to avoid regression surprises.

Low risk | Low confidence

Comment thread
heliocodacy marked this conversation as resolved.
}
Expand Down
Loading