From 4ed3a43ff1b38aa27fae9234b2e213edddabdba9 Mon Sep 17 00:00:00 2001 From: Yauheni Date: Thu, 25 Apr 2024 11:57:20 +0200 Subject: [PATCH] Added configuration and rule provider --- .gitignore | 1 + .idea/.gitignore | 3 --- .idea/gradle.xml | 16 ---------------- .idea/kotlinc.xml | 6 ------ .idea/misc.xml | 7 ------- .idea/vcs.xml | 6 ------ .../com/github/kiolk/provider/RuleProvider.kt | 17 +++++++++++++++++ ...gitlab.arturbosch.detekt.api.RuleSetProvider | 1 + src/main/resources/config/config.yml | 4 ++++ 9 files changed, 23 insertions(+), 38 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/gradle.xml delete mode 100644 .idea/kotlinc.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/vcs.xml create mode 100644 src/main/kotlin/com/github/kiolk/provider/RuleProvider.kt create mode 100644 src/main/resources/META-INF/services/io.gitlab.arturbosch.detekt.api.RuleSetProvider create mode 100644 src/main/resources/config/config.yml diff --git a/.gitignore b/.gitignore index b63da45..159e830 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ build/ .idea/jarRepositories.xml .idea/compiler.xml .idea/libraries/ +.idea/* *.iws *.iml *.ipr diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 26d3352..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 14746e7..0000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml deleted file mode 100644 index 8d81632..0000000 --- a/.idea/kotlinc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 87a20fc..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/main/kotlin/com/github/kiolk/provider/RuleProvider.kt b/src/main/kotlin/com/github/kiolk/provider/RuleProvider.kt new file mode 100644 index 0000000..32e0eeb --- /dev/null +++ b/src/main/kotlin/com/github/kiolk/provider/RuleProvider.kt @@ -0,0 +1,17 @@ +package com.github.kiolk.provider + +import com.github.kiolk.rules.UseInvokeForOperator +import io.gitlab.arturbosch.detekt.api.Config +import io.gitlab.arturbosch.detekt.api.RuleSet +import io.gitlab.arturbosch.detekt.api.RuleSetProvider + +class RuleProvider : RuleSetProvider { + + override val ruleSetId: String = "kiolk-detekt-rules" + override fun instance(config: Config): RuleSet = RuleSet( + ruleSetId, + listOf( + UseInvokeForOperator(config), + ) + ) +} diff --git a/src/main/resources/META-INF/services/io.gitlab.arturbosch.detekt.api.RuleSetProvider b/src/main/resources/META-INF/services/io.gitlab.arturbosch.detekt.api.RuleSetProvider new file mode 100644 index 0000000..64396ec --- /dev/null +++ b/src/main/resources/META-INF/services/io.gitlab.arturbosch.detekt.api.RuleSetProvider @@ -0,0 +1 @@ +com.github.kiolk.provider.RuleProvider diff --git a/src/main/resources/config/config.yml b/src/main/resources/config/config.yml new file mode 100644 index 0000000..b2beedf --- /dev/null +++ b/src/main/resources/config/config.yml @@ -0,0 +1,4 @@ +kiolk-detekt-rules: + active: true + UseInvokeForOperator: + active: true