Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD

## org.gradle.api.plugins.quality
[Groovy] Class CodeNarc

    java.lang.Object
      org.gradle.api.internal.ConventionTask
          org.gradle.api.tasks.SourceTask
              org.gradle.api.plugins.quality.CodeNarc

All Implemented Interfaces:
  Reporting, VerificationTask

    class CodeNarc
    extends SourceTask

Runs CodeNarc against some source files.

Property Summary
`FileCollection` | `codenarcClasspath` The class path containing the CodeNarc library to be used.
`File` | `configFile` The CodeNarc configuration file to use.
`boolean` | `ignoreFailures` Whether or not the build should break when the verifications performed by this task fail.
`int` | `maxPriority1Violations` The maximum number of priority 1 violations allowed before failing the build.
`int` | `maxPriority2Violations` The maximum number of priority 2 violations allowed before failing the build.
`int` | `maxPriority3Violations` The maximum number of priority 3 violations allowed before failing the build.

Constructor Summary
`CodeNarc(Instantiator instantiator, IsolatedAntBuilder antBuilder)`

Method Summary
`File` | `getReportFile()` The file to write the report to.
`String` | `getReportFormat()` The format type of the CodeNarc report.
`CodeNarcReports` | `getReports()` Returns the reports to be generated by this task.
`CodeNarcReports` | `reports(Closure closure)` Configures the reports to be generated by this task.
`void` | `run()`
`void` | `setReportFile(File reportFile)` @deprecated Use {@code reports.
`void` | `setReportFormat(String reportFormat)` @deprecated Use {@code reports.

Methods inherited from class SourceTask
exclude, exclude, exclude, exclude, getDefaultSource, getExcludes, getIncludes, getSource, include, include, include, include, setExcludes, setIncludes, setSource, source

Property Detail

### codenarcClasspath

    @InputFiles
    FileCollection codenarcClasspath

  The class path containing the CodeNarc library to be used.

### configFile

    @InputFile
    File configFile

  The CodeNarc configuration file to use.

### ignoreFailures

    boolean ignoreFailures

  Whether or not the build should break when the verifications performed by this task fail.

### maxPriority1Violations

    @Input
    int maxPriority1Violations

  The maximum number of priority 1 violations allowed before failing the build.

### maxPriority2Violations

    @Input
    int maxPriority2Violations

  The maximum number of priority 2 violations allowed before failing the build.

### maxPriority3Violations

    @Input
    int maxPriority3Violations

  The maximum number of priority 3 violations allowed before failing the build.

Constructor Detail

### CodeNarc

    @Inject
    CodeNarc(Instantiator instantiator, IsolatedAntBuilder antBuilder)

Method Detail

### getReportFile

    @Deprecated
    File getReportFile()

  The file to write the report to.
  deprecated:
    Use `reports..destination` instead.

### getReportFormat

    @Deprecated
    String getReportFormat()

  The format type of the CodeNarc report.
  deprecated:
    Use `reports..enabled` instead.

### getReports

    CodeNarcReports getReports()

  Returns the reports to be generated by this task.

### reports

    CodeNarcReports reports(Closure closure)

  Configures the reports to be generated by this task.

### run

    @TaskAction
    void run()

### setReportFile

    @Deprecated
    void setReportFile(File reportFile)

  deprecated:
    Use `reports..destination` instead.

### setReportFormat

    @Deprecated
    void setReportFormat(String reportFormat)

  deprecated:
    Use `reports..enabled` instead.

Gradle API 1.10