Hi folks, I have added detekt-formatting dependenc...
# detekt
a
Hi folks, I have added detekt-formatting dependency as mentioned here. https://detekt.dev/docs/rules/formatting#ifelsebracing But, executing
./gradlew detekt
does not show any formatting issues. Repo id required - https://github.com/Abhimanyu14/finance-manager
I also came across this discussion, https://github.com/detekt/detekt/discussions/5997 Does detekt support all the klint rules now?
n
I didn't see your detekt config file but it needs to include the formatting rules
Does detekt support all the klint rules now?
I think they're current with ktlint 1.1 but haven't updated to 1.2 yet. I'm not sure what the long term plans are though
Yeah you need to add the formatting rules here
a
Hi @Nicholas Doglio, I noticed that my issue was that even though I add rules to the config, the config file rules are ignored. (Not just formatting rules, all the rules in the file is ignored and default rules are used) (I am testing locally by adding new rules, editing existing rules, etc). I am executing detekt in the terminal.
Copy code
./gradlew detektDebug
I have added this in the project build.gradle.
Copy code
detekt {
    toolVersion = "1.23.6"
    config.setFrom(file("config/detekt/detekt.yml"))
    buildUponDefaultConfig = true
}
n
Can you push your changes? everything you’ve shared looks correct I’m not sure why it isn’t working for you
a
I have pushed my changes now.
n
I don’t see anything pushed recently
a
Pushed again now. I might have missed to push something earlier. BTW, detekt was added in my project long back, but I never actually used it. Getting around to it only now.
Found the issue. I was thinking applying the plugin only on the project build.gradle should work. Adding the plugin to all the modules works now.
Still, facing issues with formatting rules. I will share more on that once I fixed the detekt issues with current setup for all modules.