-
-
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
revive: Invalid argument to the context-as-argument rule. Unrecognized key allowtypesbefore #3280
Comments
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors. |
Hello,
As you have checked this, can you give me the output of the revive command line? |
Sure,
With the following config: [rule.context-as-argument]
arguments = [{allowTypesBefore = "*testing.T"}] as taken from here: https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-as-argument |
It's related to github.com/spf13/viper@v1.13.0 (#3205) So it's a breaking change inside Viper introduced by a bug fix, the new behavior will not change because it's the expected behavior from the Viper point of view, but it's a major problem for us. EDIT: I reverted the update of Viper #3284 (golangci-lint v1.50.1) |
This is currently incompatible with viper v1.13.0. Status for the linter found at golangci/golangci-lint#3280
This is currently incompatible with viper v1.13.0. Status for the linter found at golangci/golangci-lint#3280
This is currently incompatible with viper v1.13.0. Status for the linter found at golangci/golangci-lint#3280
This is currently incompatible with viper v1.13.0. Status for the linter found at golangci/golangci-lint#3280
This is currently incompatible with viper v1.13.0. Status for the linter found at golangci/golangci-lint#3280 Co-authored-by: Tyler Yahn <codingalias@gmail.com>
Welcome
Description of the problem
It seems that golangci-lint (starting with v1.50?) passes the arguments to linters in lower case and not "as is".
This causes in our cases
panic
inrevive
which can be tracked down to: https://github.com/mgechev/revive/blob/v1.2.4/rule/context-as-argument.go#L82-L110.
The same config with the same code base works fine with v1.49
Version of golangci-lint
Configuration file
Go environment
Verbose output of running
Code example or link to a public repository
// add your code here
The text was updated successfully, but these errors were encountered: