LintOptions

DSL object for configuring lint options.

Properties

PropertyDescription
abortOnError

Whether lint should set the exit code of the process if errors are found

absolutePaths

Whether lint should display full paths in the error output. By default the paths are relative to the path lint was invoked from.

check

The exact set of issues to check, or null to run the issues that are enabled by default plus any issues enabled via LintOptions.getEnable() and without issues disabled via LintOptions.getDisable(). If non-null, callers are allowed to modify this collection.

checkAllWarnings

Returns whether lint should check all warnings, including those off by default

checkReleaseBuilds

Returns whether lint should check for fatal errors during release builds. Default is true. If issues with severity "fatal" are found, the release build is aborted.

disable

The set of issue id's to suppress. Callers are allowed to modify this collection.

enable

The set of issue id's to enable. Callers are allowed to modify this collection. To enable a given issue, add the issue ID to the returned set.

explainIssues

Returns whether lint should include explanations for issue errors. (Note that HTML and XML reports intentionally do this unconditionally, ignoring this setting.)

htmlOutput

The optional path to where an HTML report should be written

htmlReport

Whether we should write an HTML report. Default true. The location can be controlled by LintOptions.getHtmlOutput().

ignoreWarnings

Returns whether lint will only check for errors (ignoring warnings)

lintConfig

The default configuration file to use as a fallback

noLines

Whether lint should include the source lines in the output where errors occurred (true by default)

quiet

Returns whether lint should be quiet (for example, not write informational messages such as paths to report files written)

severityOverrides

An optional map of severity overrides. The map maps from issue id's to the corresponding severity to use, which must be "fatal", "error", "warning", or "ignore".

showAll

Returns whether lint should include all output (e.g. include all alternate locations, not truncating long messages, etc.)

textOutput

The optional path to where a text report should be written. The special value "stdout" can be used to point to standard output.

textReport

Whether we should write an text report. Default false. The location can be controlled by LintOptions.getTextOutput().

warningsAsErrors

Returns whether lint should treat all warnings as errors

xmlOutput

The optional path to where an XML report should be written

xmlReport

Whether we should write an XML report. Default true. The location can be controlled by LintOptions.getXmlOutput().

Methods

MethodDescription
check(id)

Adds the id to the set of issues to check.

check(ids)

Adds the ids to the set of issues to check.

disable(id)

Adds the id to the set of issues to enable.

disable(ids)

Adds the ids to the set of issues to enable.

enable(id)

Adds the id to the set of issues to enable.

enable(ids)

Adds the ids to the set of issues to enable.

error(id)

Adds a severity override for the given issues.

error(ids)

Adds a severity override for the given issues.

fatal(id)

Adds a severity override for the given issues.

fatal(ids)

Adds a severity override for the given issues.

ignore(id)

Adds a severity override for the given issues.

ignore(ids)

Adds a severity override for the given issues.

warning(id)

Adds a severity override for the given issues.

warning(ids)

Adds a severity override for the given issues.

Script blocks

No script blocks

Property details

boolean abortOnError

Whether lint should set the exit code of the process if errors are found

boolean absolutePaths

Whether lint should display full paths in the error output. By default the paths are relative to the path lint was invoked from.

Set<String> check

The exact set of issues to check, or null to run the issues that are enabled by default plus any issues enabled via LintOptions.getEnable() and without issues disabled via LintOptions.getDisable(). If non-null, callers are allowed to modify this collection.

boolean checkAllWarnings

Returns whether lint should check all warnings, including those off by default

boolean checkReleaseBuilds

Returns whether lint should check for fatal errors during release builds. Default is true. If issues with severity "fatal" are found, the release build is aborted.

Set<String> disable

The set of issue id's to suppress. Callers are allowed to modify this collection.

Set<String> enable

The set of issue id's to enable. Callers are allowed to modify this collection. To enable a given issue, add the issue ID to the returned set.

boolean explainIssues

Returns whether lint should include explanations for issue errors. (Note that HTML and XML reports intentionally do this unconditionally, ignoring this setting.)

File htmlOutput

The optional path to where an HTML report should be written

boolean htmlReport

Whether we should write an HTML report. Default true. The location can be controlled by LintOptions.getHtmlOutput().

boolean ignoreWarnings

Returns whether lint will only check for errors (ignoring warnings)

File lintConfig

The default configuration file to use as a fallback

boolean noLines

Whether lint should include the source lines in the output where errors occurred (true by default)

boolean quiet

Returns whether lint should be quiet (for example, not write informational messages such as paths to report files written)

Map<String, Integer> severityOverrides

An optional map of severity overrides. The map maps from issue id's to the corresponding severity to use, which must be "fatal", "error", "warning", or "ignore".

boolean showAll

Returns whether lint should include all output (e.g. include all alternate locations, not truncating long messages, etc.)

File textOutput

The optional path to where a text report should be written. The special value "stdout" can be used to point to standard output.

boolean textReport

Whether we should write an text report. Default false. The location can be controlled by LintOptions.getTextOutput().

boolean warningsAsErrors

Returns whether lint should treat all warnings as errors

File xmlOutput

The optional path to where an XML report should be written

boolean xmlReport

Whether we should write an XML report. Default true. The location can be controlled by LintOptions.getXmlOutput().

Method details

void check(String id)

Adds the id to the set of issues to check.

void check(String... ids)

Adds the ids to the set of issues to check.

void disable(String id)

Adds the id to the set of issues to enable.

void disable(String... ids)

Adds the ids to the set of issues to enable.

void enable(String id)

Adds the id to the set of issues to enable.

void enable(String... ids)

Adds the ids to the set of issues to enable.

void error(String id)

Adds a severity override for the given issues.

void error(String... ids)

Adds a severity override for the given issues.

void fatal(String id)

Adds a severity override for the given issues.

void fatal(String... ids)

Adds a severity override for the given issues.

void ignore(String id)

Adds a severity override for the given issues.

void ignore(String... ids)

Adds a severity override for the given issues.

void warning(String id)

Adds a severity override for the given issues.

void warning(String... ids)

Adds a severity override for the given issues.