Package: org.gradle.api.plugins.quality

## [Groovy] Class Checkstyle

- org.gradle.api.plugins.quality.Checkstyle

- All Implemented Interfaces and Traits:
    Reporting, VerificationTask

      class Checkstyle
      extends SourceTask

  Runs Checkstyle against some source files.

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class SourceTask` | `TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION`
    `class org.gradle.api.internal.ConventionTask` | `TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION`

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `FileCollection` | `checkstyleClasspath` The class path containing the Checkstyle library to be used.
    `FileCollection` | `classpath` The class path containing the compiled classes for the source files to be analyzed.
    `TextResource` | `config` The Checkstyle configuration to use.
    `Map<String, Object>` | `configProperties` The properties available for use in the configuration file.
    `boolean` | `ignoreFailures` Whether or not this task will ignore failures and continue running the build.
    `boolean` | `showViolations` Whether or not rule violations are to be displayed on the console.

  - ### Constructor Summary

    Constructors
    Constructor and description
    `Checkstyle ()`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `org.gradle.api.internal.project.IsolatedAntBuilder` | `getAntBuilder()`
    `File` | `getConfigFile()` The Checkstyle configuration file to use.
    `org.gradle.internal.reflect.Instantiator` | `getInstantiator()`
    `CheckstyleReports` | `getReports()` The reports to be generated by this task.
    `CheckstyleReports` | `reports(groovy.lang.Closure closure)` Configures the reports to be generated by this task.
    `void` | `run()`
    `void` | `setConfigFile(File configFile)` The Checkstyle configuration file to use.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class SourceTask` | `source, getSource, getIncludes, getExcludes, setSource, include, include, include, include, include, include, include, include, setIncludes, setIncludes, exclude, exclude, exclude, exclude, exclude, exclude, exclude, exclude, setExcludes, setExcludes, conventionMapping, conventionMapping, getConventionMapping, setProperty, toString, compareTo, compareTo, getName, getActions, getState, getState, setName, getPath, getExtensions, getLogger, execute, configure, configure, getDescription, leftShift, property, isEnabled, setEnabled, getOutputs, getOutputs, dependsOn, onlyIf, onlyIf, setOnlyIf, setOnlyIf, setDidWork, getDidWork, doFirst, doFirst, deleteAllActions, getProject, getTaskDependencies, getTaskDependencies, doLast, doLast, getEnabled, getAnt, getLogging, getLogging, hasProperty, getConvention, setDescription, getGroup, setGroup, dependsOnTaskDidWork, getInputs, getTemporaryDir, mustRunAfter, setMustRunAfter, getMustRunAfter, finalizedBy, setFinalizedBy, getFinalizedBy, shouldRunAfter, setShouldRunAfter, getShouldRunAfter, setActions, getDependsOn, setDependsOn, getStandardOutputCapture, getAsDynamicObject, setProject, addValidator, prependParallelSafeAction, injectIntoNewInstance, setImpliesSubProjects, getExecuter, setExecuter, getTemporaryDirFactory, getValidators, appendParallelSafeAction, isHasCustomActions, getTaskActions, getOnlyIf, getImpliesSubProjects, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll`
    `class org.gradle.api.internal.ConventionTask` | `org.gradle.api.internal.ConventionTask#conventionMapping(java.lang.String, groovy.lang.Closure), org.gradle.api.internal.ConventionTask#conventionMapping(java.lang.String, java.util.concurrent.Callable), org.gradle.api.internal.ConventionTask#getConventionMapping(), org.gradle.api.internal.ConventionTask#setProperty(java.lang.String, java.lang.Object), org.gradle.api.internal.ConventionTask#toString(), org.gradle.api.internal.ConventionTask#compareTo(java.lang.Object), org.gradle.api.internal.ConventionTask#compareTo(org.gradle.api.Task), org.gradle.api.internal.ConventionTask#getName(), org.gradle.api.internal.ConventionTask#getActions(), org.gradle.api.internal.ConventionTask#getState(), org.gradle.api.internal.ConventionTask#getState(), org.gradle.api.internal.ConventionTask#setName(java.lang.String), org.gradle.api.internal.ConventionTask#getPath(), org.gradle.api.internal.ConventionTask#getExtensions(), org.gradle.api.internal.ConventionTask#getLogger(), org.gradle.api.internal.ConventionTask#execute(), org.gradle.api.internal.ConventionTask#configure(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#configure(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#getDescription(), org.gradle.api.internal.ConventionTask#leftShift(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#property(java.lang.String), org.gradle.api.internal.ConventionTask#isEnabled(), org.gradle.api.internal.ConventionTask#setEnabled(boolean), org.gradle.api.internal.ConventionTask#getOutputs(), org.gradle.api.internal.ConventionTask#getOutputs(), org.gradle.api.internal.ConventionTask#dependsOn([Ljava.lang.Object;), org.gradle.api.internal.ConventionTask#onlyIf(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#onlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.ConventionTask#setOnlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.ConventionTask#setOnlyIf(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#setDidWork(boolean), org.gradle.api.internal.ConventionTask#getDidWork(), org.gradle.api.internal.ConventionTask#doFirst(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#doFirst(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#deleteAllActions(), org.gradle.api.internal.ConventionTask#getProject(), org.gradle.api.internal.ConventionTask#getTaskDependencies(), org.gradle.api.internal.ConventionTask#getTaskDependencies(), org.gradle.api.internal.ConventionTask#doLast(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#doLast(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#getEnabled(), org.gradle.api.internal.ConventionTask#getAnt(), org.gradle.api.internal.ConventionTask#getLogging(), org.gradle.api.internal.ConventionTask#getLogging(), org.gradle.api.internal.ConventionTask#hasProperty(java.lang.String), org.gradle.api.internal.ConventionTask#getConvention(), org.gradle.api.internal.ConventionTask#setDescription(java.lang.String), org.gradle.api.internal.ConventionTask#getGroup(), org.gradle.api.internal.ConventionTask#setGroup(java.lang.String), org.gradle.api.internal.ConventionTask#dependsOnTaskDidWork(), org.gradle.api.internal.ConventionTask#getInputs(), org.gradle.api.internal.ConventionTask#getTemporaryDir(), org.gradle.api.internal.ConventionTask#mustRunAfter([Ljava.lang.Object;), org.gradle.api.internal.ConventionTask#setMustRunAfter(java.lang.Iterable), org.gradle.api.internal.ConventionTask#getMustRunAfter(), org.gradle.api.internal.ConventionTask#finalizedBy([Ljava.lang.Object;), org.gradle.api.internal.ConventionTask#setFinalizedBy(java.lang.Iterable), org.gradle.api.internal.ConventionTask#getFinalizedBy(), org.gradle.api.internal.ConventionTask#shouldRunAfter([Ljava.lang.Object;), org.gradle.api.internal.ConventionTask#setShouldRunAfter(java.lang.Iterable), org.gradle.api.internal.ConventionTask#getShouldRunAfter(), org.gradle.api.internal.ConventionTask#setActions(java.util.List), org.gradle.api.internal.ConventionTask#getDependsOn(), org.gradle.api.internal.ConventionTask#setDependsOn(java.lang.Iterable), org.gradle.api.internal.ConventionTask#getStandardOutputCapture(), org.gradle.api.internal.ConventionTask#getAsDynamicObject(), org.gradle.api.internal.ConventionTask#setProject(org.gradle.api.Project), org.gradle.api.internal.ConventionTask#addValidator(org.gradle.api.internal.tasks.execution.TaskValidator), org.gradle.api.internal.ConventionTask#prependParallelSafeAction(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#injectIntoNewInstance(org.gradle.api.internal.project.ProjectInternal, java.lang.String, java.util.concurrent.Callable), org.gradle.api.internal.ConventionTask#setImpliesSubProjects(boolean), org.gradle.api.internal.ConventionTask#getExecuter(), org.gradle.api.internal.ConventionTask#setExecuter(org.gradle.api.internal.tasks.TaskExecuter), org.gradle.api.internal.ConventionTask#getTemporaryDirFactory(), org.gradle.api.internal.ConventionTask#getValidators(), org.gradle.api.internal.ConventionTask#appendParallelSafeAction(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#isHasCustomActions(), org.gradle.api.internal.ConventionTask#getTaskActions(), org.gradle.api.internal.ConventionTask#getOnlyIf(), org.gradle.api.internal.ConventionTask#getImpliesSubProjects(), org.gradle.api.internal.ConventionTask#wait(long, int), org.gradle.api.internal.ConventionTask#wait(long), org.gradle.api.internal.ConventionTask#wait(), org.gradle.api.internal.ConventionTask#equals(java.lang.Object), org.gradle.api.internal.ConventionTask#hashCode(), org.gradle.api.internal.ConventionTask#getClass(), org.gradle.api.internal.ConventionTask#notify(), org.gradle.api.internal.ConventionTask#notifyAll()`

- - ### Property Detail

    - #### @InputFiles FileCollection checkstyleClasspath

      The class path containing the Checkstyle library to be used.

    - #### @InputFiles FileCollection classpath

      The class path containing the compiled classes for the source files to be analyzed.

    - #### @Incubating @Nested TextResource config

      The Checkstyle configuration to use. Replaces the `configFile` property.

      Since:
        2.2

    - #### @Input @Optional Map<String, Object> configProperties

      The properties available for use in the configuration file. These are substituted into the configuration file.

    - #### boolean ignoreFailures

      Whether or not this task will ignore failures and continue running the build.

    - #### boolean showViolations

      Whether or not rule violations are to be displayed on the console.

  - ### Constructor Detail

    - #### Checkstyle()

  - ### Method Detail

    - #### @javax.inject.Inject org.gradle.api.internal.project.IsolatedAntBuilder getAntBuilder()

    - #### File getConfigFile()

      The Checkstyle configuration file to use.

    - #### @javax.inject.Inject org.gradle.internal.reflect.Instantiator getInstantiator()

    - #### CheckstyleReports getReports()

      The reports to be generated by this task.

      Returns:
        The reports container

    - #### CheckstyleReports reports(groovy.lang.Closure closure)

      Configures the reports to be generated by this task. The contained reports can be configured by name and closures. Example:

           checkstyleTask {
             reports {
               xml {
                 destination "build/codenarc.xml"
               }
             }
           }

      Parameters:
        `closure` - The configuration
      Returns:
        The reports container

    - #### @TaskAction void run()

    - #### void setConfigFile(File configFile)

      The Checkstyle configuration file to use.