# CodeNarcExtension

abstract class CodeNarcExtension : CodeQualityExtension(source)

Configuration options for the CodeNarc plugin.

#### See also

CodeNarcPlugin

## Constructors

CodeNarcExtension
Link copied to clipboard
constructor(project: Project)

## Properties

config
Link copied to clipboard
open var config: TextResource

## Functions

getConfigFile
Link copied to clipboard
open fun getConfigFile(): File
The CodeNarc configuration file to use.
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>
getMaxPriority1Violations
Link copied to clipboard
abstract fun getMaxPriority1Violations(): Property<Integer>
The maximum number of priority 1 violations allowed before failing the build.
getMaxPriority2Violations
Link copied to clipboard
abstract fun getMaxPriority2Violations(): Property<Integer>
The maximum number of priority 2 violations allowed before failing the build.
getMaxPriority3Violations
Link copied to clipboard
abstract fun getMaxPriority3Violations(): Property<Integer>
The maximum number of priority 3 violations allowed before failing the build.
getReportFormat
Link copied to clipboard
abstract fun getReportFormat(): Property<String>
The format type of the CodeNarc report.
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.
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(file: File)
The CodeNarc configuration file to use.
setIgnoreFailures
Link copied to clipboard
open fun setIgnoreFailures(ignoreFailures: Boolean)
Whether to allow the build to continue if there are warnings.
setMaxPriority1Violations
Link copied to clipboard
open fun setMaxPriority1Violations(maxPriority1Violations: Int)
The maximum number of priority 1 violations allowed before failing the build.
setMaxPriority2Violations
Link copied to clipboard
open fun setMaxPriority2Violations(maxPriority2Violations: Int)
The maximum number of priority 2 violations allowed before failing the build.
setMaxPriority3Violations
Link copied to clipboard
open fun setMaxPriority3Violations(maxPriority3Violations: Int)
The maximum number of priority 3 violations allowed before failing the build.
setReportFormat
Link copied to clipboard
open fun setReportFormat(reportFormat: String)
Sets the format type of the CodeNarc report.
setReportsDir
Link copied to clipboard
open fun setReportsDir(reportsDir: File)
Sets the directory where reports will be generated.
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.