android-lint-examples

Project that reproduces every lint violation out there. (At least that's the idea, contributions welcome.)

UNLICENSE License

Stars
5

Project that reproduces every lint violation out there.

See settings.gradle for list of lint checks added in the project.

Goals

  • simple examples demonstrating each and every Lint check violation
  • modules focused on single Lint check
  • get every possible report for each check
    (each execution path in detectors, see CONTRIBUTING.md)
  • discover bugs in lint
    (flagged with REPORT or REPORTED comments, see CONTRIBUTING.md)

Warning

This project is not meant to show good practices, quite the opposite, code is written intentionally badly to reproduce specific Lint check violations.

That being said, I strive to use best practices and style whenever possible. Code that's not related to the lint check violation should be the best possible. For example supporting code (like build.gradles) were written with best intentions.

Examples one should almost never do in production:

  • Blindly suppress a Lint warning as "irrelevant"
    I did it here to focus on a specific issue. Rest assured, there are other modules which violate those checks too.
  • Uppercase Gradle module names
    I chose to use non-standard naming so that it's extremely clear which module deals with what lint check. It also allows to automate easily (see how lintOptions and lintVerifyCount is set up).
  • Uppercase Java/Kotlin package names
    I chose to use non-standard naming to have the check name occur in the module as text with exact text casing.

Setup & Debugging

See instructions

Reading