Fork me on GitHub

ktlint:ktlint

Note:This goal should be used as a Maven report.

Full name:

com.github.gantsign.maven:ktlint-maven-plugin:1.2.2:ktlint

Description:

A reporting task that performs ktlint analysis and generates a HTML report on any violations that ktlint finds.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: test.
  • Since version: 2.0.
  • Binds by default to the lifecycle phase: verify.

Required Parameters

Name Type Since Description
<android> boolean 2.0 Enable Android Kotlin Style Guide compatibility.
Default value is: false.
User property is: ktlint.android.
<experimental> boolean 2.0 Enable experimental rules (ktlint-ruleset-experimental).
Default value is: false.
User property is: ktlint.experimental.
<includeScripts> boolean 2.0 Include scripts.
Default value is: true.
User property is: ktlint.includeScripts.
<includeSources> boolean 2.0 Include the production source roots.
Default value is: true.
User property is: ktlint.includeSources.
<includeTestSources> boolean 2.0 Include the test source roots.
Default value is: true.
User property is: ktlint.includeTestSources.
<skip> boolean 2.0 Skips and code style checks.
Default value is: false.
User property is: ktlint.skip.
<verbose> boolean 2.0 Show error codes.
Default value is: false.
User property is: ktlint.verbose.

Optional Parameters

Name Type Since Description
<encoding> String 2.0 File file encoding of the Kotlin source files.
Default value is: ${project.build.sourceEncoding}.
User property is: encoding.
<reporters> Set 2.0 A set of reporters to output the results to.
<scriptRoots> List 2.0 A list of root directories containing Kotlin scripts.
Default value is: ${project.basedir.path}.
User property is: ktlint.scriptRoots.
<scriptsExcludes> Set 2.0 A list of exclusion filters for scripts.
<scriptsIncludes> Set 2.0 A list of inclusion filters for scripts.
Default value is: *.kts.
<sourcesExcludes> Set 2.0 A list of exclusion filters for the source files to be processed under the source roots.
<sourcesIncludes> Set 2.0 A list of inclusion filters for the source files to be processed under the source roots.
Default value is: **/*.kt.
<testSourcesExcludes> Set 2.0 A list of exclusion filters for the source files to be processed under the test source roots.
<testSourcesIncludes> Set 2.0 A list of inclusion filters for the source files to be processed under the test source roots.
Default value is: **/*.kt.

Parameter Details

<android>

Enable Android Kotlin Style Guide compatibility.
  • Type: boolean
  • Since: 2.0
  • Required: Yes
  • User Property: ktlint.android
  • Default: false

<encoding>

File file encoding of the Kotlin source files.
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: encoding
  • Default: ${project.build.sourceEncoding}

<experimental>

Enable experimental rules (ktlint-ruleset-experimental).
  • Type: boolean
  • Since: 2.0
  • Required: Yes
  • User Property: ktlint.experimental
  • Default: false

<includeScripts>

Include scripts.
  • Type: boolean
  • Since: 2.0
  • Required: Yes
  • User Property: ktlint.includeScripts
  • Default: true

<includeSources>

Include the production source roots.
  • Type: boolean
  • Since: 2.0
  • Required: Yes
  • User Property: ktlint.includeSources
  • Default: true

<includeTestSources>

Include the test source roots.
  • Type: boolean
  • Since: 2.0
  • Required: Yes
  • User Property: ktlint.includeTestSources
  • Default: true

<reporters>

A set of reporters to output the results to.
  • Type: java.util.Set
  • Since: 2.0
  • Required: No

<scriptRoots>

A list of root directories containing Kotlin scripts.
  • Type: java.util.List
  • Since: 2.0
  • Required: No
  • User Property: ktlint.scriptRoots
  • Default: ${project.basedir.path}

<scriptsExcludes>

A list of exclusion filters for scripts.
  • Type: java.util.Set
  • Since: 2.0
  • Required: No

<scriptsIncludes>

A list of inclusion filters for scripts.
  • Type: java.util.Set
  • Since: 2.0
  • Required: No
  • Default: *.kts

<skip>

Skips and code style checks.
  • Type: boolean
  • Since: 2.0
  • Required: Yes
  • User Property: ktlint.skip
  • Default: false

<sourcesExcludes>

A list of exclusion filters for the source files to be processed under the source roots.
  • Type: java.util.Set
  • Since: 2.0
  • Required: No

<sourcesIncludes>

A list of inclusion filters for the source files to be processed under the source roots.
  • Type: java.util.Set
  • Since: 2.0
  • Required: No
  • Default: **/*.kt

<testSourcesExcludes>

A list of exclusion filters for the source files to be processed under the test source roots.
  • Type: java.util.Set
  • Since: 2.0
  • Required: No

<testSourcesIncludes>

A list of inclusion filters for the source files to be processed under the test source roots.
  • Type: java.util.Set
  • Since: 2.0
  • Required: No
  • Default: **/*.kt

<verbose>

Show error codes.
  • Type: boolean
  • Since: 2.0
  • Required: Yes
  • User Property: ktlint.verbose
  • Default: false