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

dimsuz

10/14/2021, 12:37 PM
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>.*>.*"
https://detekt.github.io/detekt/extensions.html you need to exclude your custom rule from the config
something like:
Copy code
excludes: "your-ruleset-name.*"
d

dimsuz

10/14/2021, 12:56 PM
I see! Thank you, will take note of that. As for the error above, I found it was mine: I did
src/main/resources/services/...
instead of
src/main/resources/META-INF/services
. Ooops
👍 1
5 Views