android-showcase
android-showcase copied to clipboard
Detekt: Add Custom `detekt` rule
We could write custom detekt rule.
It can be any rule, but one example that comes to my head is rule that verifies clean architecture layers (verify dependency rule
correctness) - make sure that class defined in ...domain
layer does not uses any classes from other layers (have imports from other layers).
Another idea would be the rule to Verify that every class that extends androidx.lifecycle.ViewModel
class has ViewModel
suffix
Also maybe we could also add tests for this rules 🤔
More: https://arturbosch.github.io/detekt/extensions.html https://proandroiddev.com/writing-custom-lint-rules-for-your-kotlin-project-with-detekt-653e4dbbe8b9 https://medium.com/@vanniktech/writing-your-first-detekt-rule-ee940e56428d