-
Notifications
You must be signed in to change notification settings - Fork 4
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
analyzer: add options to cover all cases #42
Conversation
integer-format error-format bool-format hex-format string-format
I did not have a good command to generate all the test files... |
r.Flags.BoolVar(&n.intFormat.enabled, "integer-format", true, "enable/disable optimization of integer formatting") | ||
r.Flags.BoolVar(&n.intFormat.intConv, "int-conversion", true, "optimizes even if it requires an int or uint type cast") | ||
r.Flags.BoolVar(&n.errFormat.enabled, "error-format", true, "enable/disable optimization of error formatting") | ||
r.Flags.BoolVar(&n.errFormat.errError, "err-error", false, "optimizes into err.Error() even if it is only equivalent for non-nil errors") | ||
r.Flags.BoolVar(&n.errFormat.errorf, "errorf", true, "optimizes fmt.Errorf") | ||
r.Flags.BoolVar(&n.boolFormat, "bool-format", true, "enable/disable optimization of bool formatting") | ||
r.Flags.BoolVar(&n.hexFormat, "hex-format", true, "enable/disable optimization of hex formatting") | ||
r.Flags.BoolVar(&n.strFormat.enabled, "string-format", true, "enable/disable optimization of string formatting") | ||
r.Flags.BoolVar(&n.strFormat.sprintf1, "sprintf1", true, "optimizes fmt.Sprintf with only one argument") | ||
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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r.Flags.BoolVar(&n.intFormat.enabled, "integer-format", true, "enable/disable optimization of integer formatting") | |
r.Flags.BoolVar(&n.intFormat.intConv, "int-conversion", true, "optimizes even if it requires an int or uint type cast") | |
r.Flags.BoolVar(&n.errFormat.enabled, "error-format", true, "enable/disable optimization of error formatting") | |
r.Flags.BoolVar(&n.errFormat.errError, "err-error", false, "optimizes into err.Error() even if it is only equivalent for non-nil errors") | |
r.Flags.BoolVar(&n.errFormat.errorf, "errorf", true, "optimizes fmt.Errorf") | |
r.Flags.BoolVar(&n.boolFormat, "bool-format", true, "enable/disable optimization of bool formatting") | |
r.Flags.BoolVar(&n.hexFormat, "hex-format", true, "enable/disable optimization of hex formatting") | |
r.Flags.BoolVar(&n.strFormat.enabled, "string-format", true, "enable/disable optimization of string formatting") | |
r.Flags.BoolVar(&n.strFormat.sprintf1, "sprintf1", true, "optimizes fmt.Sprintf with only one argument") | |
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") | |
r.Flags.BoolVar(&n.intFormat.activated, "integer-format", true, "activate/deactivate optimization of integer formatting") | |
r.Flags.BoolVar(&n.intFormat.intConv, "int-conversion", true, "optimizes even if it requires an int or uint type cast") | |
r.Flags.BoolVar(&n.errFormat.activated, "error-format", true, "activate/deactivate optimization of error formatting") | |
r.Flags.BoolVar(&n.errFormat.errError, "err-error", false, "optimizes into err.Error() even if it is only equivalent for non-nil errors") | |
r.Flags.BoolVar(&n.errFormat.errorf, "errorf", true, "optimizes fmt.Errorf") | |
r.Flags.BoolVar(&n.boolFormat, "bool-format", true, "activate/deactivate optimization of bool formatting") | |
r.Flags.BoolVar(&n.hexFormat, "hex-format", true, "activate/deactivate optimization of hex formatting") | |
r.Flags.BoolVar(&n.strFormat.activated, "string-format", true, "activate/deactivate optimization of string formatting") | |
r.Flags.BoolVar(&n.strFormat.sprintf1, "sprintf1", true, "optimizes fmt.Sprintf with only one argument") | |
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") |
The code was working as a CLI. Unfortunately the code used for the testing was incomplete and misleading. Deactivating a flag such as Same for So the tests and golden files that were added were wrong, this is blocking as it prevent the code to be refactored further The problem is sorted with #44 |
For #39, new version of #41
@alexandear @mmorel-35 @ccoVeille
What do you think of this ?