willowtreeapps / assertk

assertions for kotlin inspired by assertj
MIT License
760 stars 85 forks source link

Android Lint check for junit assertions #490

Closed jzbrooks closed 9 months ago

jzbrooks commented 10 months ago

Consider a new artifact with a lint rule that detects uses of other assertion mechanisms. It probably makes the most sense to ship the rule in a separate artifact in the assertk maven group. Quick Fixes would be appreciated also—especially if they could be batch applied.

The central value in my mind is in discouraging use of assertion mechanisms that ship with testing frameworks. But it might also make sense to extend this rule to flag others assertion libraries in common use like Google Truth, Hamcrest, etc.

The benefits are twofold:

  1. It will help with incremental adoption of assertk in large projects that currently use other systems.
  2. Since the testing frameworks ship with their own assertion libraries, it is very easy for programmers unfamiliar with assertk to reach for those tools instead. A lint check could guide them toward assertk.