I had detekt-rules as a gradle sub-project, and then I moved them to a separate jar.
This jar is published in our local maven repository and added as
detektPlugins("path:to:artifact")
.
Gradle sync is finished OK, jar is downloaded and used, but when I run the 'detekt' task it prints an error that
detekt-config.yml
contains an unknown property
myrulesetname
.
I have rechecked that this published jar has
services/path.to.ruleset.Ruleset
file.
What can go wrong? Do I need to add something else to this jar?
b
Brais Gabin
10/14/2021, 12:51 PM
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:
Copy code
config:
validation: true
# 1. exclude rule set 'sample' and all its nested members
# 2. exclude every property in every rule under the rule set 'sample'
excludes: "sample.*,sample>.*>.*"