As I see in v1.2.0 was added validation of config ...
# detekt
o
As I see in v1.2.0 was added validation of config files. So after updating Detekt I receive validation error because of my custom rules:
Property 'custom-rules' is misspelled or does not exist
where 'custom-rules' is my custom ruleset's id. How is it possible to fix this and enable my custom rules again?
s
Can you please create an issue on GitHub for that? I suspect that the following commit doesn't consider custom rules and thus breaks this functionality. https://github.com/arturbosch/detekt/commit/6c3795554f24377920664bb08833202679c8a3d4
a
You can make detekt "know" about your rule set in the config:
Copy code
config:
  validation: true
  excludes: "sample-rules.*"
s
It's unfortunately a bit hidden in the docs. https://arturbosch.github.io/detekt/extensions.html Note: As of version 1.2.0 detekt now verifies if all configured properties actually exist in a configuration created by 
--generate-config
. This means that by default detekt does not know about your new properties. Therefore we need to mention them in the configuration under `config>excludes`:
o
Thanks all! Happy New year!