Skip to content
Custom ktlint ruleset for RIDI style guide.
Kotlin
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper
src
.editorconfig
.gitignore
.travis.yml
LICENSE
README.md
build.gradle
gradlew
gradlew.bat

README.md

ktlint-ruleset

Build Status

Custom ktlint ruleset for RIDI style guide.

This project was written with reference to this information.

Rules

no-exclamation-not-operator

Force use .not() method instead of an exclamation mark prefix operator(!) for logical not.

multiline-arguments

There should be line breaks both after the left parenthesis and before the right parenthesis in multiline arguments(except multiline by anonymous object literals or lambda expressions).

fun foo() {
    // Yes
    bar(1, 2, "", false)

    // No
    bar(
        1, 2, "", false)

    // Yes
    bar(
        1, 2, "", false
    )

    // No
    bar(1, 2,
        "", false)

    // Yes
    bar(
        1, 2,
        "", false
    )

    // No
    baz(bar(
        1, 2, "", false
    ))

    // Yes
    baz(
        bar(
            1, 2, "", false
        )
    )

    // Yes
    qux(object : A {
    }, 1, 2)

    // Yes
    qux(
        object : A {
        },
        1, 2
    )

    // No
    qux(object : A {
    },
    1, 2)

    // Yes
    quxx(1, 2, { _ ->
    })

    // Yes
    quxx(
        1, 2,
        { _ ->
        }
    )

    // No
    quxx(1, 2,
        { _ ->
        })

    // Yes
    quxx(1, 2, View.OnClickListener { _ ->
    })

    // Yes
    baz(when {
        true -> bar(1, 2, "", false)
        else -> null
    })
}
You can’t perform that action at this time.