Android Configure LintOptions with gradle


You can configure lint by adding a lintOptions section in the build.gradle file:

android {


    lintOptions {
        // turn off checking the given issue id's
        disable 'TypographyFractions','TypographyQuotes'

        // turn on the given issue id's
        enable 'RtlHardcoded','RtlCompat', 'RtlEnabled'

        // check *only* the given issue id's
        check 'NewApi', 'InlinedApi'

       // set to true to turn off analysis progress reporting by lint
       quiet true
       // if true, stop the gradle build if errors are found
       abortOnError false
       // if true, only report errors
       ignoreWarnings true

You can run lint for a specific variant (see below), e.g. ./gradlew lintRelease, or for all variants (./gradlew lint), in which case it produces a report which describes which specific variants a given issue applies to.

Check here for the DSL reference for all available options.