Most of the documentation surrounding configuratio...
# detekt
c
Most of the documentation surrounding configuration of a rule always leaves me hunting for the right spot to put it. For example: https://detekt.dev/docs/introduction/compose/#unusedprivatemember Where do I actually put that config? Maybe im missing something right in front of my face?
k
UnusedPrivateMember: active: true allowedNames: ''
ignoreAnnotated:
['Preview']
c
Run failed with 1 invalid config property.
- Property 'complexity>UnusedPrivateMember' is misspelled or does not exist.
k
looks like you put that in the wrong place...look at the default config file: https://github.com/detekt/detekt/blob/main/detekt-core/src/main/resources/default-detekt-config.yml
UnusedPrivateMember is under "style"
c
Yeah. Thats what i was (doing a bad job at) asking. like. is there no easy way to tell what section i need to put my rule under?
k
scroll up...it's under style
c
even reading that default yaml i gotta pull out my ruler to figure out that it goes under style
k
indentations are pretty obvious to me blob shrug
c
okay. so that helps. but im not just somehow missing "style" on this piece of docs right? https://detekt.dev/docs/introduction/compose/#unusedprivatemember
seems like its typically to just open up the default and track it down from there
look on left side
it says style blob shrug
c
gotcha. im k with that as long as i wasn't missing an easier way. lol
thanks!
b
My recommendation: remove your current configuration (or move it to have a back-up). execute
./gradlew detektGenerateConfig
. And now edit whatever you need from that file. I use it as an index of all the rules that I have to my disposal. Downside? Update it when you update detekt. To do that I use these steps: https://github.com/detekt/detekt/discussions/3558#discussioncomment-483027
But we know that our configuration process is not the cleanest so any ideas to improve it are more than welcome. It is a really complex topic.