rakutentech / android-buildconfig

Shared (gradle) build configurations for Android and Java libraries
MIT License
21 stars 26 forks source link

Add Detekt in quality tools. #29

Closed LoicDumasAQF closed 6 years ago

LoicDumasAQF commented 6 years ago

I add the Kotlin code style tool Detekt. Ktlint is problematic as it's impossible to override rules in ktlint.

I remove de check task dependency on ktlint task to replace it by detekt task.

jcayzac commented 6 years ago

Do we need to keep both?

LoicDumasAQF commented 6 years ago

Ktlint and detekt have different rule set. So ktlint will maybe return error not detected by detekt.
So I didn't removed ktlint in case of someone want to use both.

But after more reflexion, it's better to remove Ktlint to avoid confusion, as some rules are in conflict. (wildcart usage, indentation, ...). I will update the PR.

NemoOudeis commented 6 years ago

sorry for the late reply, I forgot to "submit" the review... GitHub can be quite confusing at times... =(

LoicDumasAQF commented 6 years ago

I added a lot of rules, now only 15 are disabled. Thank you for noticing ! This configuration seems good to me, tried it on our project, and returned error where interesting. After, with more experience in Kotlin some of the rules should be enabled or disabled. Anyway, with all these rules, Detekt is way better than Ktlint. If you want to get details on rules, you can find it in https://github.com/arturbosch/detekt/tree/master/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules. You need to check the javadoc in classes as their doc his 404 not found.

I also updated the Readme.md, tell me if the change log is good for you. With the "HEAD" version you added, I didn't knew how to add my change.

NemoOudeis commented 6 years ago

Yeah I noticed that the links to the rule documentation in the README are broken, but found found them on the github pages site https://arturbosch.github.io/detekt/index.html