Edit me

This rule set provides rules that address formatting issues.

Note: The formatting rule set is not included in the detekt-cli or gradle plugin.

To enable this rule set, add detektPlugins “io.gitlab.arturbosch.detekt:detekt-formatting:$version” to your gradle dependencies or reference the detekt-formatting-jar with the --plugins option in the command line interface.

AnnotationOnSeparateLine

See ktlint-website for documentation.

ChainWrapping

See ktlint-website for documentation.

CommentSpacing

See ktlint-website for documentation.

Filename

See ktlint-website for documentation.

FinalNewline

See ktlint-website for documentation.

ImportOrdering

See ktlint-website for documentation.

Indentation

See ktlint-website for documentation.

Configuration options:

  • indentSize (default: 4)

    indentation size

  • continuationIndentSize (default: 4)

    continuation indentation size

MaximumLineLength

See ktlint-website for documentation.

Configuration options:

  • maxLineLength (default: 120)

    maximum line length

ModifierOrdering

See ktlint-website for documentation.

MultiLineIfElse

See ktlint-website for documentation.

NoBlankLineBeforeRbrace

See ktlint-website for documentation.

NoConsecutiveBlankLines

See ktlint-website for documentation.

NoEmptyClassBody

See ktlint-website for documentation.

NoLineBreakAfterElse

See ktlint-website for documentation.

NoLineBreakBeforeAssignment

See ktlint-website for documentation.

NoMultipleSpaces

See ktlint-website for documentation.

NoSemicolons

See ktlint-website for documentation.

NoTrailingSpaces

See ktlint-website for documentation.

NoUnitReturn

See ktlint-website for documentation.

NoUnusedImports

See ktlint-website for documentation.

NoWildcardImports

See ktlint-website for documentation.

PackageName

See ktlint-website for documentation.

ParameterListWrapping

See ktlint-website for documentation.

Configuration options:

  • indentSize (default: 4)

    indentation size

SpacingAroundColon

See ktlint-website for documentation.

SpacingAroundComma

See ktlint-website for documentation.

SpacingAroundCurly

See ktlint-website for documentation.

SpacingAroundDot

See ktlint-website for documentation.

SpacingAroundKeyword

See ktlint-website for documentation.

SpacingAroundOperators

See ktlint-website for documentation.

SpacingAroundParens

See ktlint-website for documentation.

SpacingAroundRangeOperator

See ktlint-website for documentation.

StringTemplate

See ktlint-website for documentation.