diff options
author | Linnea Gräf <nea@nea.moe> | 2024-09-19 20:49:04 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-09-19 20:49:04 +0200 |
commit | 3724cbcfd774bae43f6fc3ac3f561922fcb2a5fa (patch) | |
tree | 426e4ac1bb584924dc5fba6cf33ebbee795c525a /src/main/java | |
parent | 6c56b6da4b8f57aa49e9df7bd949f599486e122d (diff) | |
download | skyhanni-3724cbcfd774bae43f6fc3ac3f561922fcb2a5fa.tar.gz skyhanni-3724cbcfd774bae43f6fc3ac3f561922fcb2a5fa.tar.bz2 skyhanni-3724cbcfd774bae43f6fc3ac3f561922fcb2a5fa.zip |
Fix up previous work on detekt
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/detektrules/grammar/AvoidColour.kt | 38 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/detektrules/grammar/GrammarRuleSetProvider.kt | 15 |
2 files changed, 0 insertions, 53 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/detektrules/grammar/AvoidColour.kt b/src/main/java/at/hannibal2/skyhanni/detektrules/grammar/AvoidColour.kt deleted file mode 100644 index 4b7fd2276..000000000 --- a/src/main/java/at/hannibal2/skyhanni/detektrules/grammar/AvoidColour.kt +++ /dev/null @@ -1,38 +0,0 @@ -package at.hannibal2.skyhanni.detektrules.grammar - -import io.gitlab.arturbosch.detekt.api.CodeSmell -import io.gitlab.arturbosch.detekt.api.Config -import io.gitlab.arturbosch.detekt.api.Debt -import io.gitlab.arturbosch.detekt.api.Entity -import io.gitlab.arturbosch.detekt.api.Issue -import io.gitlab.arturbosch.detekt.api.Rule -import io.gitlab.arturbosch.detekt.api.Severity -import org.jetbrains.kotlin.psi.KtStringTemplateExpression - -/** - * This rule reports all usages of the word "colour" in the codebase, - * preferring the 'American' spelling "color" - this will ignore any - * type annotations, i.e., `@ConfigEditorColour` will not be reported. - */ -class AvoidColour(config: Config) : Rule(config) { - override val issue = Issue( - "AvoidColour", - Severity.Style, - "Avoid using the word 'colour' in code, prefer 'color' instead.", - Debt.FIVE_MINS - ) - - override fun visitStringTemplateExpression(expression: KtStringTemplateExpression) { - val text = expression.text - if (text.contains("colour")) { - report( - CodeSmell( - issue, - Entity.from(expression), - "Avoid using the word 'colour' in code, prefer 'color' instead." - ) - ) - } - super.visitStringTemplateExpression(expression) - } -} diff --git a/src/main/java/at/hannibal2/skyhanni/detektrules/grammar/GrammarRuleSetProvider.kt b/src/main/java/at/hannibal2/skyhanni/detektrules/grammar/GrammarRuleSetProvider.kt deleted file mode 100644 index 963ce582b..000000000 --- a/src/main/java/at/hannibal2/skyhanni/detektrules/grammar/GrammarRuleSetProvider.kt +++ /dev/null @@ -1,15 +0,0 @@ -package at.hannibal2.skyhanni.detektrules.grammar - -import io.gitlab.arturbosch.detekt.api.Config -import io.gitlab.arturbosch.detekt.api.RuleSet -import io.gitlab.arturbosch.detekt.api.RuleSetProvider - -class GrammarRuleSetProvider : RuleSetProvider { - override val ruleSetId: String = "grammar-rules" - - override fun instance(config: Config): RuleSet { - return RuleSet(ruleSetId, listOf( - AvoidColour(config) - )) - } -} |