Package org.gradle.api.plugins.quality

# Class CodeNarcExtension

java.lang.Object
org.gradle.api.plugins.quality.CodeQualityExtension
org.gradle.api.plugins.quality.CodeNarcExtension

public abstract class CodeNarcExtension extends CodeQualityExtension
Configuration options for the CodeNarc plugin.

See Also:
  - `CodeNarcPlugin`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CodeNarcExtension(Project project)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `TextResource`
  `getConfig()`
  The CodeNarc configuration to use.
  `File`
  `getConfigFile()`
  The CodeNarc configuration file to use.
  `abstract Property<Integer>`
  `getMaxPriority1Violations()`
  The maximum number of priority 1 violations allowed before failing the build.
  `abstract Property<Integer>`
  `getMaxPriority2Violations()`
  The maximum number of priority 2 violations allowed before failing the build.
  `abstract Property<Integer>`
  `getMaxPriority3Violations()`
  The maximum number of priority 3 violations allowed before failing the build.
  `abstract Property<String>`
  `getReportFormat()`
  The format type of the CodeNarc report.
  `void`
  `setConfig(TextResource config)`
  The CodeNarc configuration to use.
  `void`
  `setConfigFile(File file)`
  The CodeNarc configuration file to use.
  `void`
  `setMaxPriority1Violations(int maxPriority1Violations)`
  The maximum number of priority 1 violations allowed before failing the build.
  `void`
  `setMaxPriority2Violations(int maxPriority2Violations)`
  The maximum number of priority 2 violations allowed before failing the build.
  `void`
  `setMaxPriority3Violations(int maxPriority3Violations)`
  The maximum number of priority 3 violations allowed before failing the build.
  `void`
  `setReportFormat(String reportFormat)`
  Sets the format type of the CodeNarc report.

  ### Methods inherited from class org.gradle.api.plugins.quality.CodeQualityExtension

  `getIgnoreFailures, getIsIgnoreFailures, getReportsDir, getSourceSets, getToolVersion, setIgnoreFailures, setReportsDir, setSourceSets, setToolVersion`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### CodeNarcExtension

    public CodeNarcExtension(Project project)

- ## Method Details

  - ### getConfig

    public TextResource getConfig()
    The CodeNarc configuration to use. Replaces the `configFile` property.
    Since:
      2.2

  - ### setConfig

    public void setConfig(TextResource config)
    The CodeNarc configuration to use. Replaces the `configFile` property.
    Since:
      2.2

  - ### getConfigFile

    public File getConfigFile()
    The CodeNarc configuration file to use.

  - ### setConfigFile

    public void setConfigFile(File file)
    The CodeNarc configuration file to use.

  - ### getMaxPriority1Violations

    public abstract Property<Integer> getMaxPriority1Violations()
    The maximum number of priority 1 violations allowed before failing the build.

  - ### setMaxPriority1Violations

    public void setMaxPriority1Violations(int maxPriority1Violations)
    The maximum number of priority 1 violations allowed before failing the build.

  - ### getMaxPriority2Violations

    public abstract Property<Integer> getMaxPriority2Violations()
    The maximum number of priority 2 violations allowed before failing the build.

  - ### setMaxPriority2Violations

    public void setMaxPriority2Violations(int maxPriority2Violations)
    The maximum number of priority 2 violations allowed before failing the build.

  - ### getMaxPriority3Violations

    public abstract Property<Integer> getMaxPriority3Violations()
    The maximum number of priority 3 violations allowed before failing the build.

  - ### setMaxPriority3Violations

    public void setMaxPriority3Violations(int maxPriority3Violations)
    The maximum number of priority 3 violations allowed before failing the build.

  - ### getReportFormat

    public abstract Property<String> getReportFormat()
    The format type of the CodeNarc report. One of `html`, `xml`, `text`, `console`.

  - ### setReportFormat

    public void setReportFormat(String reportFormat)
    Sets the format type of the CodeNarc report.