-
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
Rules definitions #39
Comments
Please remember that we have to maximize compatibility with existing rules: perfsprint:
# Optimizes even if it requires an int or uint type cast.
# Default: true
int-conversion: false
# Optimizes into `err.Error()` even if it is only equivalent for non-nil errors.
# Default: false
err-error: true
# Optimizes `fmt.Errorf`.
# Default: true
errorf: false
# Optimizes `fmt.Sprintf` with only one argument.
# Default: true
sprintf1: false
# Optimizes into strings concatenation.
# Default: true
strconcat: false Maybe it is better to add simply only one |
Let's name it hex-format ? |
I was more likely to report them the way @alexandear suggested. So hex would be reported as string-format But, then the logic of having a way to configure what linter is enabled, it won't be easy. Does it mean that it would be reported as |
Another distinct question, the related configuration would be something I try to think about the configuration at the same time as the way we report them |
I guess you need some rules like One thing to emphasize about current option is that there are some that do behavior changes :
|
The actual rules needs to clearly explicit to be easily understood and used by the users. This is a first draft that needs to be challenged to then enable the separation of concerns in the tool.
error-format
with:
error-format.err-error
option equivalent toerr-error
to useerr.Error()
even if it is only equivalent for non-nil errorsstring-format
with
string-format.concat
option equivalent tostrconcat
to enable strings concatenationbool-format
hash-format
integer-format
with
integer-format.cast
option equivalent toint-conversion
to enable int or uint type castThe text was updated successfully, but these errors were encountered: