contactstore icon indicating copy to clipboard operation
contactstore copied to clipboard

Create static analysis gradle task (detekt + lint)

Open alexstyl opened this issue 2 years ago • 1 comments

There are more people contributing to the project lately, and it would be nice to have less moderation required on each PR. This issue is about creating a gradle task to run static analysis in the project.

Requirements:

  • Introduce detekt in the project (link to Detekt)
  • Create a gradle task called runStaticAnalysis which would run Android lint and detekt.
  • Document is a way (i.e. on your PR) how the static analysis works (such as how to change the rules of each tools).
  • Static analysis should run on all modules (library, library-test, sample) with the same rules.

Keep in mind that there are going to be way more detekt and lint issues than the default thresholds. There is no need to fix anything in the code that the static analysis will pick up. Instead, increases the threshold of allowed issues to the number of issues detected.

There is no need for this work to take place in a single PR.

If you would like to pick up this task, reply to this issue, so that I can assign it to you.

Link to Detekt: https://detekt.github.io/detekt/ Example Project with static analysis set up: https://github.com/code-with-the-italians/bundel/

alexstyl avatar Jan 06 '22 11:01 alexstyl

No need to increase the threshold, they should be strict to enforce good practices in future development Major lint issues can be fixed right away and others can be suppressed with the baseline and from time to time contributors can fix it from baseline - a good opportunity for future contributors and newcomers.

tatocaster avatar Jan 06 '22 12:01 tatocaster

Closing this as it's been more than a year open

alexstyl avatar Apr 23 '23 16:04 alexstyl