Configure detectors to only run when the Lint client is Gradle but not Android Studio.

Skip to first unread message

kiran puppala

Sep 7, 2021, 10:06:06 AM9/7/21
to lint-dev
Hi Tor, 
We want few detectors to run only when Gradle lint task is executed but should not run from Android Studio. 
We want to execute some detectors only when the Lint client is Gradle. I know we can do that by checking the client while writing detector logic using this method LintClient.isGradle().

We would like to know if there's a more robust way of doing this instead of making this check everywhere inside detectors. Can we exclude few detectors in the Issue Registry based on the Lint client?


class CustomIssueRegistry : IssueRegistry() {
override val issues: List<Issue>
      get() = if (LintClient.isGradle) {
                  } else {
Reply all
Reply to author
0 new messages