mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 15:17:05 +05:30
feat(detekt): add Twitter's Compose rules
This commit is contained in:
parent
2685111c70
commit
0f684a3728
3 changed files with 51 additions and 0 deletions
10
.github/renovate.json
vendored
10
.github/renovate.json
vendored
|
@ -26,6 +26,16 @@
|
||||||
],
|
],
|
||||||
"datasourceTemplate": "maven",
|
"datasourceTemplate": "maven",
|
||||||
"depNameTemplate": "com.facebook:ktfmt"
|
"depNameTemplate": "com.facebook:ktfmt"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fileMatch": [
|
||||||
|
".kt$"
|
||||||
|
],
|
||||||
|
"matchStrings": [
|
||||||
|
"TWITTER_RULES_VERSION = \"(?<currentValue>.*)\""
|
||||||
|
],
|
||||||
|
"datasourceTemplate": "maven",
|
||||||
|
"depNameTemplate": "com.twitter.compose.rules:detekt"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@ import org.gradle.kotlin.dsl.configure
|
||||||
import org.gradle.language.base.plugins.LifecycleBasePlugin
|
import org.gradle.language.base.plugins.LifecycleBasePlugin
|
||||||
|
|
||||||
object Detekt {
|
object Detekt {
|
||||||
|
private const val TWITTER_RULES_VERSION = "0.0.17"
|
||||||
|
|
||||||
fun apply(project: Project) {
|
fun apply(project: Project) {
|
||||||
project.pluginManager.apply(DetektPlugin::class.java)
|
project.pluginManager.apply(DetektPlugin::class.java)
|
||||||
project.extensions.configure<DetektExtension> {
|
project.extensions.configure<DetektExtension> {
|
||||||
|
@ -24,5 +26,9 @@ object Detekt {
|
||||||
dependsOn(project.tasks.named("detekt"))
|
dependsOn(project.tasks.named("detekt"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
project.dependencies.add(
|
||||||
|
"detektPlugins",
|
||||||
|
"com.twitter.compose.rules:detekt:$TWITTER_RULES_VERSION",
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -712,3 +712,38 @@ style:
|
||||||
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
|
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
|
||||||
excludeImports:
|
excludeImports:
|
||||||
- 'java.util.*'
|
- 'java.util.*'
|
||||||
|
|
||||||
|
TwitterCompose:
|
||||||
|
CompositionLocalAllowlist:
|
||||||
|
active: true
|
||||||
|
# allowedCompositionLocals: LocalSomething,LocalSomethingElse
|
||||||
|
CompositionLocalNaming:
|
||||||
|
active: true
|
||||||
|
ContentEmitterReturningValues:
|
||||||
|
active: true
|
||||||
|
# contentEmitters: MyComposable,MyOtherComposable
|
||||||
|
ModifierComposable:
|
||||||
|
active: true
|
||||||
|
ModifierMissing:
|
||||||
|
active: true
|
||||||
|
ModifierReused:
|
||||||
|
active: true
|
||||||
|
ModifierWithoutDefault:
|
||||||
|
active: true
|
||||||
|
MultipleEmitters:
|
||||||
|
active: true
|
||||||
|
# contentEmitters: MyComposable,MyOtherComposable
|
||||||
|
MutableParams:
|
||||||
|
active: true
|
||||||
|
ComposableNaming:
|
||||||
|
active: true
|
||||||
|
ComposableParamOrder:
|
||||||
|
active: true
|
||||||
|
PreviewPublic:
|
||||||
|
active: true
|
||||||
|
RememberMissing:
|
||||||
|
active: true
|
||||||
|
ViewModelForwarding:
|
||||||
|
active: true
|
||||||
|
ViewModelInjection:
|
||||||
|
active: true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue