-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move detekt to external project and migrate config to plugin (…
…AR-2904) (#1294) * chore: move config to external proj ref * chore: remove internal module * chore: remove internal module * chore: comments * chore: refactor config detekt as plugin * chore: refactor config detekt as plugin * chore: refactor config detekt as plugin, comments * chore: pr comments
- Loading branch information
1 parent
24e64e6
commit bec2e66
Showing
12 changed files
with
74 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package scripts | ||
|
||
import com.wire.kalium.plugins.libs | ||
import getLocalProperty | ||
import io.gitlab.arturbosch.detekt.Detekt | ||
|
||
plugins { | ||
id("io.gitlab.arturbosch.detekt") | ||
} | ||
|
||
dependencies { | ||
val detektVersion = libs.findVersion("detekt").get() | ||
detekt("io.gitlab.arturbosch.detekt:detekt-cli:$detektVersion") | ||
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:$detektVersion") | ||
detektPlugins("com.wire:detekt-rules:1.0.0-SNAPSHOT") { | ||
isChanging = true | ||
} | ||
} | ||
|
||
detekt { | ||
buildUponDefaultConfig = true | ||
// activate all available (even unstable) rules. | ||
// allRules = false | ||
config = files("$rootDir/detekt/detekt.yml") | ||
source = files("$rootDir") | ||
// a way of suppressing issues before introducing detekt | ||
baseline = file("$rootDir/detekt/baseline.xml") | ||
|
||
// dynamic prop to enable and disable autocorrect, enabled locally via local.properties file | ||
val autoFixEnabled = getLocalProperty("detektAutofix", "false") | ||
autoCorrect = autoFixEnabled.toBoolean() | ||
println("> Detekt autoCorrect: $autoFixEnabled") | ||
} | ||
|
||
tasks.withType<Detekt> { | ||
reports.html.required.set(true) // observe findings in your browser with structure and code snippets | ||
reports.xml.required.set(true) | ||
reports.txt.required.set(false) | ||
|
||
// general detekt ignore patterns of files, instead of by rule | ||
exclude( | ||
"buildSrc/**", | ||
"**/build/**", | ||
"**/test/**", | ||
"**/*Test/**", | ||
"**/protobuf/**", | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
41 changes: 0 additions & 41 deletions
41
detekt-rules/src/main/java/com/wire/detekt/rules/DocumentedPublicUseCases.kt
This file was deleted.
Oops, something went wrong.
61 changes: 0 additions & 61 deletions
61
detekt-rules/src/main/java/com/wire/detekt/rules/EnforceSerializableFields.kt
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
detekt-rules/src/main/java/com/wire/detekt/rules/RuleExtensions.kt
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
detekt-rules/src/main/java/com/wire/detekt/rules/WireRuleSetProvider.kt
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...ules/src/main/resources/META-INF/services/io.gitlab.arturbosch.detekt.api.RuleSetProvider
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.