Skip to content

Commit

Permalink
analyzer: consistency settings for options
Browse files Browse the repository at this point in the history
  • Loading branch information
catenacyber committed Jan 30, 2025
1 parent 2518a2c commit 0375e34
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions analyzer/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ import (
)

type optionInt struct {
enabled bool
enabled bool
intConv bool
}

type optionErr struct {
enabled bool
enabled bool
errError bool
errorf bool
}

type optionStr struct {
enabled bool
enabled bool
sprintf1 bool
strconcat bool
}
Expand Down Expand Up @@ -74,6 +74,19 @@ func New() *analysis.Analyzer {
r.Flags.BoolVar(&n.strFormat.strconcat, "strconcat", true, "optimizes into strings concatenation")
r.Flags.BoolVar(&n.fiximports, "fiximports", true, "fix needed imports from other fixes")

if !n.intFormat.enabled {
n.intFormat.intConv = false
}

if !n.errFormat.enabled {
n.errFormat.errError = false
n.errFormat.errorf = false
}
if !n.strFormat.enabled {
n.strFormat.sprintf1 = false
n.strFormat.strconcat = false
}

return r
}

Expand Down

0 comments on commit 0375e34

Please sign in to comment.