com.pinterest.ktlint.ruleset.standard.StandardRule.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ktlint-ruleset-standard Show documentation
Show all versions of ktlint-ruleset-standard Show documentation
An anti-bikeshedding Kotlin linter with built-in formatter.
package com.pinterest.ktlint.ruleset.standard
import com.pinterest.ktlint.rule.engine.core.api.Rule
import com.pinterest.ktlint.rule.engine.core.api.RuleId
import com.pinterest.ktlint.rule.engine.core.api.RuleSetId
import com.pinterest.ktlint.rule.engine.core.api.editorconfig.EditorConfigProperty
internal val STANDARD_RULE_ABOUT =
Rule.About(
maintainer = "KtLint",
repositoryUrl = "https://github.com/pinterest/ktlint",
issueTrackerUrl = "https://github.com/pinterest/ktlint/issues",
)
/**
* Standard rules can only be declared and instantiated in the 'ktlint-ruleset-standard'. Custom rule set providers or API consumers have
* to extend the [Rule] class to define a custom rule.
*/
public open class StandardRule internal constructor(
id: String,
override val visitorModifiers: Set = emptySet(),
override val usesEditorConfigProperties: Set> = emptySet(),
) : Rule(
ruleId = RuleId("${RuleSetId.STANDARD.value}:$id"),
visitorModifiers = visitorModifiers,
usesEditorConfigProperties = usesEditorConfigProperties,
about = STANDARD_RULE_ABOUT,
)
© 2015 - 2024 Weber Informatics LLC | Privacy Policy