# CodeNarcExtension

API Documentation: | `CodeNarcExtension`

Configuration options for the CodeNarc plugin.

### Properties

Property | Description
`config` | The CodeNarc configuration to use. Replaces the `configFile` property.
`configFile` | The CodeNarc configuration file to use.
`ignoreFailures` | Whether to allow the build to continue if there are warnings. Example: ignoreFailures = true
`maxPriority1Violations` | The maximum number of priority 1 violations allowed before failing the build.
`maxPriority2Violations` | The maximum number of priority 2 violations allowed before failing the build.
`maxPriority3Violations` | The maximum number of priority 3 violations allowed before failing the build.
`reportFormat` | The format type of the CodeNarc report. One of `html`, `xml`, `text`, `console`.
`reportsDir` | The directory where reports will be generated.
`sourceSets` | The source sets to be analyzed as part of the `check` and `build` tasks.
`toolVersion` | The version of the code quality tool to be used.

### Methods

No methods

### Script blocks

No script blocks

### Property details

#### `TextResource` `config`

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

Default with `codenarc` plugin:
  ``${project.projectDir}`/config/codenarc/codenarc.xml`

#### `File` `configFile`

The CodeNarc configuration file to use.

Default with `codenarc` plugin:
  ``${project.projectDir}`/config/codenarc/codenarc.xml`

#### ``Property`<`Boolean`>` `ignoreFailures`

Whether to allow the build to continue if there are warnings. Example: ignoreFailures = true

Default:
  `false`

#### ``Property`<`Integer`>` `maxPriority1Violations`

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

Default with `codenarc` plugin:
  `0`

#### ``Property`<`Integer`>` `maxPriority2Violations`

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

Default with `codenarc` plugin:
  `0`

#### ``Property`<`Integer`>` `maxPriority3Violations`

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

Default with `codenarc` plugin:
  `0`

#### ``Property`<`String`>` `reportFormat`

The format type of the CodeNarc report. One of `html`, `xml`, `text`, `console`.

Default with `codenarc` plugin:
  `html`

#### `DirectoryProperty` `reportsDir`

The directory where reports will be generated.

Default with `codenarc` plugin:
  ``${project.reporting.baseDirectory}`/codenarc`

#### ``ListProperty`<`SourceSet`>` `sourceSets`

The source sets to be analyzed as part of the `check` and `build` tasks.

Default:
  `project.sourceSets`

#### ``Property`<`String`>` `toolVersion`

The version of the code quality tool to be used.

Default with `codenarc` plugin:
  `1.2.1`