-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Update WSL to v1.2.1 #794
Merged
Merged
Update WSL to v1.2.1 #794
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 this necessary given the defaults added to
config.go
. We probably only want one place the default values can be set and sourced from.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 that there should be one place for the defaults and right now they're all true which is kind of bad if you want to marshal the configuration from
.golangci.yml
but good if you don't want negative names. :)How do you propose I should attack this issue? I want the values to be
true
by default and therefore I don't want them in the.golangci.yaml
. However if they're not present and the the configuration is being unmarshalled their default values will be false (unless I use pointers). Because of this I added theWSLSettings
which is set inconfig.go
to default them totrue
if the config is empty. So the only way to set them tofalse
right now is to explicitly specify that in the configuration, otherwise the defaults will be made.Do you think I should re-write how this is handled in the linter itself (e.g. don't expose
DefaultConfig()
) or am I missing something obvious about how the defaults are set ingolangci-lint
? I still think there might be use-cases for WSL outside golangci-lint. The only other idea I have right now is to change the config to be negative such asNoStrictAppend
andNoMultiLineAssign
but then we're at negative names again.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 don't have a strong recommendation but if you want
golangci-lint
's setting to derive from the linter directly I would set that within theconfig.go
file. However, my general feeling is it might be better to just havegolangci-lint
have a copy of its own defaults that way the defaults can't change when upgrading the linter in the future (potentially a breaking change to users). This implies removing thewsl.DefaultConfig()
assignment here and mapping the struct fields 1:1.