-
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 definition #41
Rules definition #41
Conversation
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.
Is it possible to write tests to ensure we don't break anything with all these new options?
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.
I agree.
What is the best way ?
Have analysistest.RunWithSuggestedFixes(t, analysistest.TestData(), a, "somedir")
for all 10 options with a different value than the default one ?
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.
The tests caught an error with fmt.Errorf("toto") becoming just a string when disabling error-format ;-)
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.
I'm less present lately for personal reasons.
I might reply with delay if you have questions, but here are my remarks.
And I agree with @alexandear tests are needed
As consistency between options is done at init time
and invert the negation in consequences
r.Flags.BoolVar(&n.fiximports, "fiximports", true, "fix needed imports from other fixes") | ||
r.Flags.BoolVar(&n.strconcat, "strconcat", true, "optimizes into strings concatenation") | ||
|
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.
You should not need all of that. Your algorithm shall start by checking if a format is activated and then trigger check their option.
Let's try to follow KISS principle here
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.
But some default options being true, I still need to do the check
I pushed a new version in #42 |
For #39
@alexandear @mmorel-35 @ccoVeille
What do you think of this ?