# CheckstyleExtension

abstract class CheckstyleExtension : CodeQualityExtension(source)

Configuration options for the Checkstyle plugin.

#### See also

CheckstylePlugin

## Constructors

CheckstyleExtension
Link copied to clipboard
constructor(project: Project)

## Properties

config
Link copied to clipboard
open var config: TextResource

## Functions

getConfigDirectory
Link copied to clipboard
abstract fun getConfigDirectory(): DirectoryProperty
Path to other Checkstyle configuration files.
getConfigFile
Link copied to clipboard
open fun getConfigFile(): File
The Checkstyle configuration file to use.
getConfigProperties
Link copied to clipboard
abstract fun getConfigProperties(): MapProperty<String, Any>
The properties available for use in the configuration file.
getEnableExternalDtdLoad
Link copied to clipboard
@Incubating
@Optional
@Input
abstract fun getEnableExternalDtdLoad(): Property<Boolean>
Enable the ability to use custom DTD files in config and load them from some location on all checkstyle tasks in this project.
getIgnoreFailures
Link copied to clipboard
abstract fun getIgnoreFailures(): Property<Boolean>
Whether to allow the build to continue if there are warnings.
getIsIgnoreFailures
Link copied to clipboard
open fun getIsIgnoreFailures(): Property<Boolean>
getIsShowViolations
Link copied to clipboard
open fun getIsShowViolations(): Property<Boolean>
getMaxErrors
Link copied to clipboard
abstract fun getMaxErrors(): Property<Integer>
The maximum number of errors that are tolerated before breaking the build or setting the failure property.
getMaxWarnings
Link copied to clipboard
abstract fun getMaxWarnings(): Property<Integer>
The maximum number of warnings that are tolerated before breaking the build or setting the failure property.
getReportsDir
Link copied to clipboard
@ReplacedBy(value = "reportsDirectory")
open fun getReportsDir(): File
The directory where reports will be generated.
getReportsDirectory
Link copied to clipboard
@Incubating
abstract fun getReportsDirectory(): DirectoryProperty
The directory where reports will be generated.
getShowViolations
Link copied to clipboard
abstract fun getShowViolations(): Property<Boolean>
Whether rule violations are to be displayed on the console.
getSourceSets
Link copied to clipboard
abstract fun getSourceSets(): ListProperty<SourceSet>
The source sets to be analyzed as part of the `check` and `build` tasks.
getToolVersion
Link copied to clipboard
abstract fun getToolVersion(): Property<String>
The version of the code quality tool to be used.
setConfigFile
Link copied to clipboard
open fun setConfigFile(configFile: File)
The Checkstyle configuration file to use.
setConfigProperties
Link copied to clipboard
open fun setConfigProperties(configProperties: Map<String, Any>)
The properties available for use in the configuration file.
setConfigProperties
Link copied to clipboard
inline fun CheckstyleExtension.setConfigProperties(vararg configProperties: Pair<String, Any>)

Kotlin extension function for org.gradle.api.plugins.quality.CheckstyleExtension.setConfigProperties.

setIgnoreFailures
Link copied to clipboard
open fun setIgnoreFailures(ignoreFailures: Boolean)
Whether to allow the build to continue if there are warnings.
setMaxErrors
Link copied to clipboard
open fun setMaxErrors(maxErrors: Int)
Set the maximum number of errors that are tolerated before breaking the build.
setMaxWarnings
Link copied to clipboard
open fun setMaxWarnings(maxWarnings: Int)
Set the maximum number of warnings that are tolerated before breaking the build.
setReportsDir
Link copied to clipboard
open fun setReportsDir(reportsDir: File)
Sets the directory where reports will be generated.
setShowViolations
Link copied to clipboard
open fun setShowViolations(showViolations: Boolean)
Whether rule violations are to be displayed on the console.
setSourceSets
Link copied to clipboard
open fun setSourceSets(sourceSets: Collection<SourceSet>)
The source sets to be analyzed as part of the `check` and `build` tasks.
setToolVersion
Link copied to clipboard
open fun setToolVersion(toolVersion: String)
The version of the code quality tool to be used.