android-showcase icon indicating copy to clipboard operation
android-showcase copied to clipboard

Detekt: Add Custom `detekt` rule

Open igorwojda opened this issue 4 years ago • 0 comments

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

igorwojda avatar Apr 19 '20 19:04 igorwojda