-
As titled, I'm looking for a non-android solution to this, which uses an Android linter library:
I hope this might be possible in compile time through the definition of a custom config definition or something similar, but I'm not familiar with static analyzers, so this is all speculation |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey @elect86
That's totally doable. You can create your custom rule using this template https://github.com/detekt/detekt-custom-rule-template And inspect the DSL calls + verify that certain parameters are declared or not. It can be totally custom (i.e. you hardcode the business logic inside the body of the rule) or you can provide some degree of configurability via external params or so. |
Beta Was this translation helpful? Give feedback.
-
Ok so, I pushed (I modified one of the tests):
My first idea is to work around But I have no idea how to do this.. any idea? |
Beta Was this translation helpful? Give feedback.
Hey @elect86
That's totally doable. You can create your custom rule using this template https://github.com/detekt/detekt-custom-rule-template
And inspect the DSL calls + verify that certain parameters are declared or not. It can be totally custom (i.e. you hardcode the business logic inside the body of the rule) or you can provide some degree of configurability via external params or so.