-
-
Notifications
You must be signed in to change notification settings - Fork 769
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
Invalid boolean config values are evaluated silently to false #2045
Comments
Hey, thanks for reporting this. The error message is:
Can it be that you are using a wrong value which cannot be converted to a boolean for an |
Fair remark. Then the question arises - why do configuration files work alone? After all, then they contain all the same "incorrect values" that cannot be converted. |
Since detekt's now validates the config options, I'm asking whether this problem still applies? |
I think I figured out the problem. Firstly, I had a typo, which I could only see by chance in the editor with a different syntax highlighting :). In one of the configuration files, I used Using only one configuration file with: potential-bugs:
active: true
RedundantElseInWhen:
active: fasle I get a successful result. But if you use such a configuration file in a list of several, then the As a result, it turns out that I was faced with the fact that the detector says that it works correctly when the configuration file is transferred to it with an error (and not vice versa, as I described in the issue header). The last tests I conducted on kotlin Please comment. Maybe someone will try to reproduce. |
Did you try to do the following in your config:
validation: true |
Co-Authored-By: Brais Gabín <braisgabin@gmail.com>
Co-Authored-By: Brais Gabín <braisgabin@gmail.com>
Expected Behavior
I can use any number of configuration files.
Observed Behavior
If I use 3 or more configuration files, detekt always throws an error when completing a task.
Steps to Reproduce
I use my task:
And the service does not note errors in the code, but prints it to the log:
https://gist.github.com/kepocnhh/558c85a50419df1a1db400eb54786d96
Context
This error occurs only if the configuration files are 3 or more. That is, in all other cases, the detekt works:
or
or
or
or
or
common.yml is
the rest are like that
❕ Each configuration file is unique.
Your Environment
java 1.8.0_221
kotlin 1.3.50
detekt 1.1.1
Gradle 5.5.1
macOS Mojave Version 10.14.6 (18G87)
The text was updated successfully, but these errors were encountered: