Skip to content
Merged
Changes from 1 commit
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 @@
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("Creating new config file for tool %s\n", toolName)

Check failure on line 320 in cmd/analyze.go

View workflow job for this annotation

GitHub Actions / build

cannot use toolName (variable of type string) as logrus.Fields value in argument to logger.Info

Check failure on line 320 in cmd/analyze.go

View workflow job for this annotation

GitHub Actions / test

cannot use toolName (variable of type string) as logrus.Fields value in argument to logger.Info

Check failure on line 320 in cmd/analyze.go

View workflow job for this annotation

GitHub Actions / build

cannot use toolName (variable of type string) as logrus.Fields value in argument to logger.Info
Comment thread
heliocodacy marked this conversation as resolved.
Outdated
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] Using logger.Info("Creating new config file for tool %s\n", toolName) mixes printf-style formatting with structured logging idioms. Confirm that logger.Info supports format strings and that the newline is necessary — prefer structured logging (e.g. logger.Infof(...) if available, or logger.Info("Creating new config file for tool", "tool", toolName)) to avoid ambiguity.

Medium risk | Medium confidence

if err := configsetup.CreateToolConfigurationFile(toolName, initFlags); err != nil {
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