https://kotlinlang.org logo
#detekt
Title
# detekt
o

oleg_osipenko

12/28/2019, 2:40 PM
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

schalkms

12/30/2019, 4:42 PM
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

Artur Bosch

01/01/2020, 2:22 PM
You can make detekt "know" about your rule set in the config:
Copy code
config:
  validation: true
  excludes: "sample-rules.*"
s

schalkms

01/01/2020, 8:52 PM
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

oleg_osipenko

01/01/2020, 9:48 PM
Thanks all! Happy New year!
10 Views