Class ErrorProneOptions
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheck(String checkName, CheckSeverity severity) Adds a check with a given severity.voidcheck(String checkName, org.gradle.api.provider.Provider<CheckSeverity> severity) Adds a check with a given severity.final voidcheck(kotlin.Pair<String, CheckSeverity>... pairs) Adds pairs of check name to severity.voidDisable checks.voidAdds checks with their default severity.voidAdds checks with error severity.abstract org.gradle.api.provider.Property<Boolean> Enables all Error Prone checks, checks that are disabled by default are enabled as warnings; maps to-XepAllDisabledChecksAsWarnings.abstract org.gradle.api.provider.Property<Boolean> Turns all Error Prone errors into warnings; maps to-XepAllErrorsAsWarnings.abstract org.gradle.api.provider.Property<Boolean> Turn all Error Prone suggestions into warnings; maps to-XepAllSuggestionsAsWarnings.A map of check options to their value.abstract org.gradle.api.provider.MapProperty<String, CheckSeverity> A map of check name toCheckSeverity, to configure which checks are enabled or disabled, and their severity.abstract org.gradle.api.provider.Property<Boolean> Tells Error Prone that the compilation contains only test code; maps to-XepCompilingTestOnlyCode.abstract org.gradle.api.provider.Property<Boolean> Disable all Error Prone checks; maps to-XepDisableAllChecks.abstract org.gradle.api.provider.Property<Boolean> Disables all Error Prone warnings; maps to-XepDisableAllWarnings.abstract org.gradle.api.provider.Property<Boolean> Disables warnings in classes annotated withjavax.annotation.processing.Generatedor@javax.annotation.Generated; maps to-XepDisableWarningsInGeneratedCode.abstract org.gradle.api.provider.Property<Boolean> Allows disabling Error Prone altogether for the task.abstract org.gradle.api.provider.ListProperty<String> Additional arguments passed to Error Prone.List<org.gradle.process.CommandLineArgumentProvider> A list ofCommandLineArgumentProviderfor additional arguments passed to Error Prone.abstract org.gradle.api.provider.Property<String> A regular expression pattern (as a string) of file paths to exclude from Error Prone checking; maps to-XepExcludedPaths.abstract org.gradle.api.provider.Property<Boolean> Ignores suppression annotations, such as@SuppressWarnings; maps to-XepIgnoreSuppressionAnnotations.abstract org.gradle.api.provider.Property<Boolean> Tells Error Prone to ignore unknown check names inchecks; maps to-XepIgnoreUknownCheckNames.voidAdds a check option with atrueboolean value.voidAdds a check option with a given boolean value.voidAdds a check option with a given value.voidAdds a check option with a given value.static voidoption$default(ErrorProneOptions options, String name, boolean unusedBoolean, int unusedInt, Object unusedObject) Deprecated.Kept only for kotlin binary backward-compatibility.toString()voidAdds checks with warning severity.
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
ErrorProneOptions
public ErrorProneOptions()
-
-
Method Details
-
getEnabled
Allows disabling Error Prone altogether for the task.Error Prone will still be in the annotation processor path, but
-Xplugin:ErrorPronewon't be passed as a CompileOptions.getCompilerArgs() compiler argument}.Defaults to
trueontasks for source sets,falseotherwise. -
getDisableAllChecks
Disable all Error Prone checks; maps to-XepDisableAllChecks.This will be the first argument, so checks can then be re-enabled on a case-by-case basis.
-
getDisableAllWarnings
Disables all Error Prone warnings; maps to-XepDisableAllWarnings.This will be among the first arguments, so checks can then be re-enabled on a case-by-case basis.
-
getAllErrorsAsWarnings
Turns all Error Prone errors into warnings; maps to-XepAllErrorsAsWarnings.This will be among the first arguments, so checks can then be promoted back to error on a case-by-case basis.
-
getAllSuggestionsAsWarnings
Turn all Error Prone suggestions into warnings; maps to-XepAllSuggestionsAsWarnings.This will be among the first arguments, so checks can then be demoted back to suggestions on a case-by-case basis.
-
getAllDisabledChecksAsWarnings
Enables all Error Prone checks, checks that are disabled by default are enabled as warnings; maps to-XepAllDisabledChecksAsWarnings.This will be among the first arguments, so checks can then be disabled again on a case-by-case basis.
-
getDisableWarningsInGeneratedCode
@Input public abstract org.gradle.api.provider.Property<Boolean> getDisableWarningsInGeneratedCode()Disables warnings in classes annotated withjavax.annotation.processing.Generatedor@javax.annotation.Generated; maps to-XepDisableWarningsInGeneratedCode. -
getIgnoreUnknownCheckNames
Tells Error Prone to ignore unknown check names inchecks; maps to-XepIgnoreUknownCheckNames. -
getIgnoreSuppressionAnnotations
Ignores suppression annotations, such as@SuppressWarnings; maps to-XepIgnoreSuppressionAnnotations. -
getCompilingTestOnlyCode
Tells Error Prone that the compilation contains only test code; maps to-XepCompilingTestOnlyCode.Defaults to
truefor a source set inferred as a test source set,falseotherwise. -
getExcludedPaths
A regular expression pattern (as a string) of file paths to exclude from Error Prone checking; maps to-XepExcludedPaths. -
getChecks
A map of check name toCheckSeverity, to configure which checks are enabled or disabled, and their severity.Maps each entry to
-Xep:<key>:<value>, or-Xep:<key>when the value isCheckSeverity.DEFAULT.- See Also:
-
getCheckOptions
A map of check options to their value.Use an explicit
"true"value for a boolean option.Maps each entry to
-XepOpt:<key>=<value>.- See Also:
-
getErrorproneArgs
Additional arguments passed to Error Prone. -
getErrorproneArgumentProviders
A list ofCommandLineArgumentProviderfor additional arguments passed to Error Prone. -
check
Adds pairs of check name to severity.Equivalent to calling
check(first, second)for each pair.- See Also:
-
check
Adds a check with a given severity.Equivalent to
checks.put(checkName, severity).- See Also:
-
check
Adds a check with a given severity.Equivalent to
checks.put(checkName, severity).- See Also:
-
enable
Adds checks with their default severity.Useful in combination with
disableAllChecksto selectively re-enable checks.Equivalent to calling
check(checkName, CheckSeverity.DEFAULT)for each check name.- See Also:
-
disable
Disable checks.Equivalent to calling
check(checkName, CheckSeverity.OFF)for each check name.- See Also:
-
warn
Adds checks with warning severity.Equivalent to calling
check(checkName, CheckSeverity.WARN)for each check name.- See Also:
-
error
Adds checks with error severity.Equivalent to calling
check(checkName, CheckSeverity.ERROR)for each check name.- See Also:
-
option
Adds a check option with atrueboolean value.Equivalent to
checkOptions.put(name, "true").- See Also:
-
option$default
@Deprecated @Deprecated(message="Kept only for kotlin binary backward-compatibility", level=HIDDEN) public static void option$default(ErrorProneOptions options, String name, boolean unusedBoolean, int unusedInt, Object unusedObject) Deprecated.Kept only for kotlin binary backward-compatibility. -
option
Adds a check option with a given boolean value.Equivalent to
checkOptions.put(name, String.valueOf(value)).- See Also:
-
option
Adds a check option with a given value.Equivalent to
checkOptions.put(name, value).- See Also:
-
option
Adds a check option with a given value.Equivalent to
checkOptions.put(name, value).- See Also:
-
toString
-