AndroidLintReporter icon indicating copy to clipboard operation
AndroidLintReporter copied to clipboard

Fail report when tests are failing / comments are added

Open alfonsogarza opened this issue 2 years ago • 1 comments

When there are lint or detetk errors and comments are added to the Pull Request, could there be a way of signaling a failure so the "Check" in the Pull Request fails?

Currently, even when comments are added the check/report succeeds. Maybe this is a little out of scope as the tool becomes more of a checker than reporter, but would like to hear your thoughts.

alfonsogarza avatar Jul 18 '21 00:07 alfonsogarza

This is indeed outside the scope of this project, but I think you can already do what you want.

For example, for running detekt, it's in fact throwing an error by default, that's why in my Readme, I have to add continue-on-error: true to make it not trigger the error.

      - name: Run detekt
        run: ./gradlew detekt
        continue-on-error: true

If you remove this line, detekt should throw error whenever there's a warning.

As for lint, I think you can use this configuration on your gradle:

android {
  lintOptions {
    warningsAsErrors true
  }
}

Whenever there's a warning, it will cause a build error.

Hope it helps!

worker8 avatar Jul 28 '21 18:07 worker8