mrmans0n / compose-rules

Lint rules for ktlint/detekt aimed to contribute to a healthier usage of Compose. Actively maintained and evolved fork of the Twitter Compose rules.
https://mrmans0n.github.io/compose-rules
Other
550 stars 21 forks source link

Prevent false positives in ModifierReused due to early returns #317

Closed mrmans0n closed 1 month ago

mrmans0n commented 1 month ago

It was easy to trick ModifierReused for a false positive when using an early return. With these changes, that's harder now. I also had the chance to rewrite this part of the code to make it simpler to understand, and more robust -- so win/win I guess?

Added some unit tests as the cherry on top.