Fork me on GitHub

ktlint:check

Full name:

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

Description:

Checks for violations of the code style.

Attributes:

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

Required Parameters

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

Optional Parameters

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

<encoding>

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

<experimental>

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

<failOnViolation>

Whether to fail the build if the linter finds violations of the code style.
  • Type: boolean
  • Required: Yes
  • User Property: ktlint.failOnViolation
  • Default: true

<includeScripts>

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

<includeSources>

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

<includeTestSources>

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

<reporters>

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

<scriptRoots>

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

<scriptsExcludes>

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

<scriptsIncludes>

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

<skip>

Skips and code style checks.
  • Type: boolean
  • 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
  • Required: No

<sourcesIncludes>

A list of inclusion filters for the source files to be processed under the source roots.
  • Type: java.util.Set
  • 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
  • Required: No

<testSourcesIncludes>

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

<verbose>

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