A complete backup of ktlint.github.io

Are you over 18 and want to see adult content?

2

More Annotations

Mucize Doktor 19. bölüm- Ali Nazlı'ya açılıyor! Mucize Doktor 20. bölüm fragmanı yayınlandı mı-

Mucize Doktor 19. bölüm- Ali Nazlı'ya açılıyor! Mucize Doktor 20. bölüm fragmanı yayınlandı mı-

www.haberturk.com/mucize-doktor-19-bolum-ali-nazli-ya-aciliyor-mucize-doktor-20-bolum-fragmani-yayinlandi-mi-2561529-magazin
Profile Image
Ellen Grant
2020-01-28 20:28:19
Mucize Doktor 19. bölüm- Ali Nazlı'ya açılıyor! Mucize Doktor 20. bölüm fragmanı yayınlandı mı-

Mucize Doktor 19. bölüm- Ali Nazlı'ya açılıyor! Mucize Doktor 20. bölüm fragmanı yayınlandı mı-

www.haberturk.com/mucize-doktor-19-bolum-ali-nazli-ya-aciliyor-mucize-doktor-20-bolum-fragmani-yayinlandi-mi-2561529-magazin

Are you over 18 and want to see adult content?

Medellín se estrenó con victoria en el Atanasio

Medellín se estrenó con victoria en el Atanasio

www.elcolombiano.com/deportes/independiente-medellin/dim-supero-2-1-a-rionegro-en-la-fecha-2-de-la-playliga-bet-KF12358103
Profile Image
Ellen Grant
2020-01-28 20:28:37
Medellín se estrenó con victoria en el Atanasio

Medellín se estrenó con victoria en el Atanasio

www.elcolombiano.com/deportes/independiente-medellin/dim-supero-2-1-a-rionegro-en-la-fecha-2-de-la-playliga-bet-KF12358103

Are you over 18 and want to see adult content?

Dura denuncia de Ortigoza- -Me ofrecieron plata para ir para atrás-

Dura denuncia de Ortigoza- -Me ofrecieron plata para ir para atrás-

radiomitre.cienradios.com/dura-denuncia-de-ortigoza-me-ofrecieron-plata-para-ir-para-atras/
Profile Image
Ellen Grant
2020-01-28 20:28:46
Dura denuncia de Ortigoza- -Me ofrecieron plata para ir para atrás-

Dura denuncia de Ortigoza- -Me ofrecieron plata para ir para atrás-

radiomitre.cienradios.com/dura-denuncia-de-ortigoza-me-ofrecieron-plata-para-ir-para-atras/

Are you over 18 and want to see adult content?

JFK Docs Tied to Ex-California Governors Sold at Auction – NBC Los Angeles - The Union Journal

JFK Docs Tied to Ex-California Governors Sold at Auction – NBC Los Angeles - The Union Journal

theunionjournal.com/jfk-docs-tied-to-ex-california-governors-sold-at-auction-nbc-los-angeles/
Profile Image
Ellen Grant
2020-01-28 20:29:01
JFK Docs Tied to Ex-California Governors Sold at Auction – NBC Los Angeles - The Union Journal

JFK Docs Tied to Ex-California Governors Sold at Auction – NBC Los Angeles - The Union Journal

theunionjournal.com/jfk-docs-tied-to-ex-california-governors-sold-at-auction-nbc-los-angeles/

Are you over 18 and want to see adult content?

NBA- Allen Iverson Helped Kobe Bryant Become 'Black Mamba'

NBA- Allen Iverson Helped Kobe Bryant Become 'Black Mamba'

www.ibtimes.com/nba-allen-iverson-helped-kobe-bryant-become-black-mamba-2910129
Profile Image
Ellen Grant
2020-01-28 20:29:01
NBA- Allen Iverson Helped Kobe Bryant Become 'Black Mamba'

NBA- Allen Iverson Helped Kobe Bryant Become 'Black Mamba'

www.ibtimes.com/nba-allen-iverson-helped-kobe-bryant-become-black-mamba-2910129

Are you over 18 and want to see adult content?

Watford's Andre Gray Gives Away Free-Kick From Kick-Off In A Truly Bizarre Moment - SPORTbible

Watford's Andre Gray Gives Away Free-Kick From Kick-Off In A Truly Bizarre Moment - SPORTbible

www.sportbible.com/football/reactions-news-fails-funny-watfords-andre-gray-gives-away-free-kick-from-kick-off-20200124
Profile Image
Ellen Grant
2020-01-28 20:29:24
Watford's Andre Gray Gives Away Free-Kick From Kick-Off In A Truly Bizarre Moment - SPORTbible

Watford's Andre Gray Gives Away Free-Kick From Kick-Off In A Truly Bizarre Moment - SPORTbible

www.sportbible.com/football/reactions-news-fails-funny-watfords-andre-gray-gives-away-free-kick-from-kick-off-20200124

Are you over 18 and want to see adult content?

4
Talking Points from Tranmere v Man Utd 26 January 2020 - Manchester United

Talking Points from Tranmere v Man Utd 26 January 2020 - Manchester United

www.manutd.com/en/news/detail/talking-points-from-tranmere-v-man-utd-26-january-2020
Profile Image
Ellen Grant
2020-01-28 20:29:26
Talking Points from Tranmere v Man Utd 26 January 2020 - Manchester United

Talking Points from Tranmere v Man Utd 26 January 2020 - Manchester United

www.manutd.com/en/news/detail/talking-points-from-tranmere-v-man-utd-26-january-2020

Are you over 18 and want to see adult content?

Federer y otro -milagro-- salvó 7 match points dolorido y pasó a la semi - Olé

Federer y otro -milagro-- salvó 7 match points dolorido y pasó a la semi - Olé

www.ole.com.ar/tenis/federer-roger-tennys-sandgren-australia-salvo-match-points-dolor_0_OpDR5avU.html
Profile Image
Ellen Grant
2020-01-28 20:29:50
Federer y otro -milagro-- salvó 7 match points dolorido y pasó a la semi - Olé

Federer y otro -milagro-- salvó 7 match points dolorido y pasó a la semi - Olé

www.ole.com.ar/tenis/federer-roger-tennys-sandgren-australia-salvo-match-points-dolor_0_OpDR5avU.html

Are you over 18 and want to see adult content?

Mais um infetado na Europa. Confirmado caso de coronavírus na Alemanha - DN

Mais um infetado na Europa. Confirmado caso de coronavírus na Alemanha - DN

www.dn.pt/mundo/mais-um-infetado-na-europa-confirmado-caso-de-coronavirus-na-alemanha-11756116.html
Profile Image
Ellen Grant
2020-01-28 20:30:07
Mais um infetado na Europa. Confirmado caso de coronavírus na Alemanha - DN

Mais um infetado na Europa. Confirmado caso de coronavírus na Alemanha - DN

www.dn.pt/mundo/mais-um-infetado-na-europa-confirmado-caso-de-coronavirus-na-alemanha-11756116.html

Are you over 18 and want to see adult content?

Why Kobe Bryant chose to be called the 'Black Mamba' - CBSSports.com

Why Kobe Bryant chose to be called the 'Black Mamba' - CBSSports.com

www.cbssports.com/nba/news/why-kobe-bryant-chose-to-be-called-the-black-mamba/
Profile Image
Ellen Grant
2020-01-28 20:30:41
Why Kobe Bryant chose to be called the 'Black Mamba' - CBSSports.com

Why Kobe Bryant chose to be called the 'Black Mamba' - CBSSports.com

www.cbssports.com/nba/news/why-kobe-bryant-chose-to-be-called-the-black-mamba/

Are you over 18 and want to see adult content?

Google Drive working again after thousands of users report it being down - WRBL

Google Drive working again after thousands of users report it being down - WRBL

www.wrbl.com/news/google-drive-is-down-thousands-of-users-report/
Profile Image
Ellen Grant
2020-01-28 20:30:43
Google Drive working again after thousands of users report it being down - WRBL

Google Drive working again after thousands of users report it being down - WRBL

www.wrbl.com/news/google-drive-is-down-thousands-of-users-report/

Are you over 18 and want to see adult content?

Zalim İstanbul 29. bölüm fragman yayınlandı mı- Zalim İstanbul 29. bölüm fragman izle! - Son dakika Güncel haberleri

Zalim İstanbul 29. bölüm fragman yayınlandı mı- Zalim İstanbul 29. bölüm fragman izle! - Son dakika Güncel haberleri

www.fotospor.com/haber-guncel-zalim-istanbul-29-bolum-fragman-yayinlandi-mi-zalim-istanbul-29-bolum-fragman-izle-361499
Profile Image
Ellen Grant
2020-01-28 20:30:48
Zalim İstanbul 29. bölüm fragman yayınlandı mı- Zalim İstanbul 29. bölüm fragman izle! - Son dakika Güncel haberleri

Zalim İstanbul 29. bölüm fragman yayınlandı mı- Zalim İstanbul 29. bölüm fragman izle! - Son dakika Güncel haberleri

www.fotospor.com/haber-guncel-zalim-istanbul-29-bolum-fragman-yayinlandi-mi-zalim-istanbul-29-bolum-fragman-izle-361499

Are you over 18 and want to see adult content?

3

Favourite Annotations

Talent Plus PH – Talents within Reach

Talent Plus PH – Talents within Reach

talentplus.ph
Profile Image
Ellen Grant
2020-04-20 08:37:08
Talent Plus PH – Talents within Reach

Talent Plus PH – Talents within Reach

talentplus.ph

Are you over 18 and want to see adult content?

Cell Press- Neuron

Cell Press- Neuron

neuron.org
Profile Image
Ellen Grant
2020-04-20 08:37:23
Cell Press- Neuron

Cell Press- Neuron

neuron.org

Are you over 18 and want to see adult content?

Le Crédit 100- en Ligne – Réponse en 24h - Younited Credit

Le Crédit 100- en Ligne – Réponse en 24h - Younited Credit

younited-credit.com
Profile Image
Ellen Grant
2020-04-20 08:37:51
Le Crédit 100- en Ligne – Réponse en 24h - Younited Credit

Le Crédit 100- en Ligne – Réponse en 24h - Younited Credit

younited-credit.com

Are you over 18 and want to see adult content?

Nashville Film Festival - FILM - MUSIC - CULTURE Nashville Film Festival

Nashville Film Festival - FILM - MUSIC - CULTURE Nashville Film Festival

nashvillefilmfestival.org
Profile Image
Ellen Grant
2020-04-20 08:38:03
Nashville Film Festival - FILM - MUSIC - CULTURE Nashville Film Festival

Nashville Film Festival - FILM - MUSIC - CULTURE Nashville Film Festival

nashvillefilmfestival.org

Are you over 18 and want to see adult content?

Home - Alice Cooper

Home - Alice Cooper

alicecooper.com
Profile Image
Ellen Grant
2020-04-20 08:38:18
Home - Alice Cooper

Home - Alice Cooper

alicecooper.com

Are you over 18 and want to see adult content?

Homepage - Comite Maritime International - CMI

Homepage - Comite Maritime International - CMI

comitemaritime.org
Profile Image
Ellen Grant
2020-04-20 08:38:59
Homepage - Comite Maritime International - CMI

Homepage - Comite Maritime International - CMI

comitemaritime.org

Are you over 18 and want to see adult content?

3
Espresso Machines - Espresso Machine Reviews - Seattle Coffee Gear

Espresso Machines - Espresso Machine Reviews - Seattle Coffee Gear

espressozone.com
Profile Image
Ellen Grant
2020-04-20 08:39:12
Espresso Machines - Espresso Machine Reviews - Seattle Coffee Gear

Espresso Machines - Espresso Machine Reviews - Seattle Coffee Gear

espressozone.com

Are you over 18 and want to see adult content?

A complete backup of montrespaschers.fr

A complete backup of montrespaschers.fr

montrespaschers.fr
Profile Image
Ellen Grant
2020-04-20 08:39:23
A complete backup of montrespaschers.fr

A complete backup of montrespaschers.fr

montrespaschers.fr

Are you over 18 and want to see adult content?

Home - Mattereum

Home - Mattereum

mattereum.com
Profile Image
Ellen Grant
2020-04-20 08:39:46
Home - Mattereum

Home - Mattereum

mattereum.com

Are you over 18 and want to see adult content?

Fonds de la Recherche Scientifique - FNRS - Le FNRS

Fonds de la Recherche Scientifique - FNRS - Le FNRS

frs-fnrs.be
Profile Image
Ellen Grant
2020-04-20 08:40:16
Fonds de la Recherche Scientifique - FNRS - Le FNRS

Fonds de la Recherche Scientifique - FNRS - Le FNRS

frs-fnrs.be

Are you over 18 and want to see adult content?

Tocatì – Festival Internazionale dei Giochi in Strada

Tocatì – Festival Internazionale dei Giochi in Strada

tocati.it
Profile Image
Ellen Grant
2020-04-20 08:40:35
Tocatì – Festival Internazionale dei Giochi in Strada

Tocatì – Festival Internazionale dei Giochi in Strada

tocati.it

Are you over 18 and want to see adult content?

Radars for Border, Perimeter, Coastline & Drone Security - Blighter

Radars for Border, Perimeter, Coastline & Drone Security - Blighter

blighter.com
Profile Image
Ellen Grant
2020-04-20 08:41:01
Radars for Border, Perimeter, Coastline & Drone Security - Blighter

Radars for Border, Perimeter, Coastline & Drone Security - Blighter

blighter.com

Are you over 18 and want to see adult content?

3

Text

KTLINT

ktlint is a single binary with both linter & formatter included. All you need is to drop it in (no need to get overwhelmed while choosing among dozens of code style options ). fiber_manual_record. Can I have my own rules on top of ktlint? Absolutely, "no configuration" doesn't mean "no extensibility".

KTLINT

ktlint is a single binary with both linter & formatter included. All you need is to drop it in (no need to get overwhelmed while choosing among dozens of code style options ). fiber_manual_record. Can I have my own rules on top of ktlint? Absolutely, "no configuration" doesn't mean "no extensibility".

KTLINT

ktlint is a single binary with both linter & formatter included. All you need is to drop it in (no need to get overwhelmed while choosing among dozens of code style options ). fiber_manual_record. Can I have my own rules on top of ktlint? Absolutely, "no configuration" doesn't mean "no extensibility".

KTLINT

ktlint is a single binary with both linter & formatter included. All you need is to drop it in (no need to get overwhelmed while choosing among dozens of code style options ). fiber_manual_record. Can I have my own rules on top of ktlint? Absolutely, "no configuration" doesn't mean "no extensibility".

KTLINT

ktlint is a single binary with both linter & formatter included. All you need is to drop it in (no need to get overwhelmed while choosing among dozens of code style options ). fiber_manual_record. Can I have my own rules on top of ktlint? Absolutely, "no configuration" doesn't mean "no extensibility".

KTLINT

ktlint is a single binary with both linter & formatter included. All you need is to drop it in (no need to get overwhelmed while choosing among dozens of code style options ). fiber_manual_record. Can I have my own rules on top of ktlint? Absolutely, "no configuration" doesn't mean "no extensibility".

KTLINT

ktlint is a single binary with both linter & formatter included. All you need is to drop it in (no need to get overwhelmed while choosing among dozens of code style options ). fiber_manual_record. Can I have my own rules on top of ktlint? Absolutely, "no configuration" doesn't mean "no extensibility".

KTLINT

ktlint is a single binary with both linter & formatter included. All you need is to drop it in (no need to get overwhelmed while choosing among dozens of code style options ). fiber_manual_record. Can I have my own rules on top of ktlint? Absolutely, "no configuration" doesn't mean "no extensibility".

KTLINT

ktlint is a single binary with both linter & formatter included. All you need is to drop it in (no need to get overwhelmed while choosing among dozens of code style options ). fiber_manual_record. Can I have my own rules on top of ktlint? Absolutely, "no configuration" doesn't mean "no extensibility".

KTLINT

ktlint is a single binary with both linter & formatter included. All you need is to drop it in (no need to get overwhelmed while choosing among dozens of code style options ). fiber_manual_record. Can I have my own rules on top of ktlint? Absolutely, "no configuration" doesn't mean "no extensibility".

KTLINT

ktlint is a single binary with both linter & formatter included. All you need is to drop it in (no need to get overwhelmed while choosing among dozens of code style options ). fiber_manual_record. Can I have my own rules on top of ktlint? Absolutely, "no configuration" doesn't mean "no extensibility".

KTLINT

ktlint is a single binary with both linter & formatter included. All you need is to drop it in (no need to get overwhelmed while choosing among dozens of code style options ). fiber_manual_record. Can I have my own rules on top of ktlint? Absolutely, "no configuration" doesn't mean "no extensibility".

KTLINT

ktlint is a single binary with both linter & formatter included. All you need is to drop it in (no need to get overwhelmed while choosing among dozens of code style options ). fiber_manual_record. Can I have my own rules on top of ktlint? Absolutely, "no configuration" doesn't mean "no extensibility".

KTLINT

ktlint is a single binary with both linter & formatter included. All you need is to drop it in (no need to get overwhelmed while choosing among dozens of code style options ). fiber_manual_record. Can I have my own rules on top of ktlint? Absolutely, "no configuration" doesn't mean "no extensibility".

KTLINT

ktlint is a single binary with both linter & formatter included. All you need is to drop it in (no need to get overwhelmed while choosing among dozens of code style options ). fiber_manual_record. Can I have my own rules on top of ktlint? Absolutely, "no configuration" doesn't mean "no extensibility".

__

ktlint

Getting Started Rules FAQ GitHub Getting Started Rules FAQ GitHub

ktlint

An anti-bikeshedding Kotlin linter with built-in formatter.

Getting Started

Command Line Maven Gradle

INSTALLATION

curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.35.0/ktlint && chmod a+x ktlint # you can also download ktlint manually from https://github.com/pinterest/ktlint/releases # another option is "brew install ktlint" # verify PGP signature (optional but recommended) curl -sS https://keybase.io/pinterestandroid/pgp_keys.asc | gpg --import curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.35.0/ktlint.asc gpg --verify ktlint.asc

USAGE

# check the style of all Kotlin files inside the current dir (recursively) # (hidden folders will be skipped)

$ ktlint

src/main/kotlin/Main.kt:10:10: Unused import # check only certain locations (prepend ! to negate the pattern) $ ktlint "src/**/*.kt" "!src/**/*Test.kt" # auto-correct style violations # (if some errors cannot be fixed automatically they will be printed to stderr) $ ktlint -F "src/**/*.kt" # print style violations grouped by file $ ktlint --reporter=plain?group_by_file # print style violations as usual + create report in checkstyle format $ ktlint --reporter=plain --reporter=checkstyle,output=ktlint-report-in-checkstyle-format.xml # install git hook to automatically check files for style violations on commit $ ktlint --install-git-pre-commit-hook

INTEGRATION

Add the following snippet to pom.xml (inside ...)

org.apache.maven.plugins maven-antrun-plugin 1.7

ktlint

verify

run

ktlint-format

run

com.pinterest ktlint 0.35.0

USAGE

# check code style (it's also bound to "mvn verify") $ mvn antrun:run@ktlint src/main/kotlin/Main.kt:10:10: Unused import # fix code style deviations (runs built-in formatter) $ mvn antrun:run@ktlint-format

INTEGRATION

PLUGINS (RECOMMENDED) There are few community-driven plugins (in order of appearance): * jlleitschuh/ktlint-gradle

Gradle plugin that

automatically creates check and format tasks for project Kotlin sources, supports different kotlin plugins and Gradle build caching. * jeremymailen/kotlinter-gradle

Gradle plugin

featuring incremental build support, file reports, .kt & .kts source

support.

* diffplug/spotless

Spotless is not really a plugin, it's a standalone project that happens to have a built-in ktlint support. In addition to linting/formatting kotlin code it allows you to keep license headers, markdown documentation, etc. in check.

WITHOUT PLUGINS

Add the following snippet to build.gradle apply plugin: "java"

repositories {

jcenter()

}

configurations {

ktlint

}

dependencies {

ktlint "com.pinterest:ktlint:0.35.0" // additional 3rd party ruleset(s) can be specified here // just add them to the classpath (ktlint 'groupId:artifactId:version') and // ktlint will pick them up

}

task ktlint(type: JavaExec, group: "verification") { description = "Check Kotlin code style." main = "com.pinterest.ktlint.Main" classpath = configurations.ktlint

args "src/**/*.kt"

// to generate report in checkstyle format prepend following args: // "--reporter=plain", "--reporter=checkstyle,output=${buildDir}/ktlint.xml" // see https://github.com/pinterest/ktlint#usage for more

}

check.dependsOn ktlint task ktlintFormat(type: JavaExec, group: "formatting") { description = "Fix Kotlin code style deviations." main = "com.pinterest.ktlint.Main" classpath = configurations.ktlint args "-F", "src/**/*.kt"

}

USAGE

# check code style (it's also bound to "gradle check")

$ gradle ktlint

src/main/kotlin/Main.kt:10:10: Unused import # fix code style deviations (runs built-in formatter) $ gradle ktlintFormat

Rules

4 SPACES FOR INDENTATION*.

Do.

data class C(

val a: Any,

val b: Any = 0,

val c: Any

) {}

Don't.

data class C(val a: Any,

val b: Any = 0,

val c: Any) {

}

* Starting from 0.8.0

value of

indent_size specified under section in .editorconfig takes precedence (if any). Official recommendation is to use 4 spaces, though. (see #43

for details)

NO SEMICOLONS.

Do.

val v = ""

println(v)

// semicolons used to separate multiple statements on the same line are OK // try avoid though fn({ v -> println(v); v * 10 })

Don't.

val v = "";

println(v);

NO WILDCARD / UNUSED IMPORTS.

Do.

import io.vertx.core.Vertx import com.google.Guice import com.google.Injector

Don't.

import io.vertx.core.* import com.google.inject.* import pkg.UnusedClass NO CONSECUTIVE BLANK LINES.

Do.

class A {}

class B {}

Don't.

// this in not a Python and you are not in PEP 8 realm

class A {}

class B {}

NO TRAILING WHITESPACES.

Do.

class A {}

class B {}

Don't.

class A {}⋅⋅⋅

class B {}⋅

* If you don't use EditorConfig it's a good time to start.

NO UNIT RETURNS.

Do.

fun f() {}

Don't.

fun f(): Unit {}

NO EMPTY CLASS BODIES.

Do.

class A

interface B

Don't.

class A {}

interface B {}

CONSISTENT STRING TEMPLATES.

Do.

val a = "class = ${String::class}" val b = "not $a"

Don't.

val a = "class = ${String::class.toString()}" val b = "not ${a}" CONSISTENT ORDER OF MODIFIERS.

Do.

internal abstract class A { protected open val v = "" internal open suspend fun f(v: Any): Any = "" public lateinit var lv: String abstract tailrec fun findFixPoint(x: Double = 1.0): Double

}

class B : A() {

public override val v = "" suspend override fun f(v: Any): Any = "" tailrec override fun findFixPoint(x: Double): Double = if (x == Math.cos(x)) x else findFixPoint(Math.cos(x))

}

Don't.

abstract internal class A { open protected val v = "" open suspend internal fun f(v: Any): Any = "" lateinit public var lv: String tailrec abstract fun findFixPoint(x: Double = 1.0): Double

}

class B : A() {

override public val v = "" override suspend fun f(v: Any): Any = "" override tailrec fun findFixPoint(x: Double): Double = if (x == Math.cos(x)) x else findFixPoint(Math.cos(x))

}

CONSISTENT SPACING.

Do.

val short = ""

val long = ""

val v = a - b * c class A : B, C {}

if (true) {}

@file:JvmName("Main")

class A : B

call(object : C() {}) fun fn(@field:F a: Any, b: Any, c: Any): Any val v: String = str() if (ok) { /* .. */ } fn({ v -> f(v) * g(v) }) emptyList().find { true }!!.hashCode() find { it.default ?: false }?.phone

Don't.

// multiple spaces after "val long" for vertical alignment

val short = ""

val long  = ""

// no spacing around operators

val v=a-b*c

// no space after the comma class A : B,C {} // no spacing after keyword ("if" in this case)

if(true) {}

// incorrect spacing around ":" @file: JvmName("Main")

class A:B

call(object: C() {}) fun fn(@field: F a:Any, b:Any, c:Any):Any val v:String = str() // missing spacing around "{" and before "}" if (true){/* .. */} // missing spacing after "{" and before "}" fn({v -> f(v) * g(v)}!!) // unnecessary space after "}" emptyList().find { true } !!.hashCode() find { it.default ?: false } ?.phone

FAQ

_FIBER_MANUAL_RECORD_WHY SHOULD I USE KTLINT?

SIMPLICITY.

Spending time on configuration (& maintenance down the road) of hundred-line long style config file(s) is counter-productive. Instead of wasting your energy on something that has no business value - focus on what really matters (not debating whether to use tabs or spaces). By using ktlint you put the importance of code clarity and community conventions over personal preferences. This makes things easier for people reading your code as well as frees you from having to document & explain what style potential contributor(s) have to follow. ktlint is a single binary with both linter & formatter included. All you need is to drop it in (no need to get overwhelmed while choosing among dozens of code style options

).

_FIBER_MANUAL_RECORD_CAN I HAVE MY OWN RULES ON TOP OF KTLINT? Absolutely, "no configuration" doesn't mean "no extensibility". You can add your own ruleset(s) to discover potential bugs, check for

anti-patterns, etc.

See Creating A Ruleset

on GitHub.

_FIBER_MANUAL_RECORD_HOW DO I SUPPRESS AN ERROR? This is meant primarily as an escape latch for the rare cases when ktlint is not able to produce the correct result (please report any such instances using GitHub Issues

).

To disable a specific rule you'll need to turn on the verbose mode (ktlint --verbose ...). At the end of each line you'll see an error code. Use it as an argument for ktlint-disable directive (shown

below).

import package.* // ktlint-disable no-wildcard-imports /* ktlint-disable no-wildcard-imports */

import package.a.*

import package.b.*

/* ktlint-enable no-wildcard-imports */ To disable all checks: import package.* // ktlint-disable _FIBER_MANUAL_RECORD_HOW DO I GLOBALLY DISABLE A RULE? See the EditorConfig

section on GitHub.

You may also use the --disabled_rules command line flag.

_favorite_

Details

5

Copyright © 2023 ArchiveBay.com. All rights reserved. Terms of Use | Privacy Policy | DMCA | 2021 | Feedback | Advertising | RSS 2.0