feat(marketplace): add detekt-rules-koin ruleset#9070
Conversation
Adds detekt-rules-koin — 51 static analysis rules for Koin 4.x, covering service locator anti-patterns, module DSL, scope management, platform-specific and Koin Annotations rules. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9070 +/- ##
============================================
- Coverage 85.04% 85.01% -0.03%
+ Complexity 4422 4420 -2
============================================
Files 569 569
Lines 12303 12282 -21
Branches 2672 2673 +1
============================================
- Hits 10463 10442 -21
+ Misses 680 678 -2
- Partials 1160 1162 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds the detekt-rules-koin extension to the Detekt marketplace, providing 51 static analysis rules for Koin 4.x dependency injection framework. The ruleset enforces best practices across service locator patterns, module DSL, scope management, platform-specific code (Android, Compose, Ktor), architecture, and Koin annotations.
Changes:
- Added detekt-rules-koin marketplace entry with 51 rules for Koin 4.x static analysis
- Configured entry with usesTypeResolution: false and appropriate ruleset metadata
- Listed all 51 rule names in alphabetical order
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| title: "detekt-rules-koin", | ||
| description: | ||
| "51 rules for Koin 4.x — enforces best practices and catches common anti-patterns via static analysis.", | ||
| repo: "https://github.com/androidbroadcast/Koin-Detekt", | ||
| ruleset: "koin-rules", | ||
| rules: [ | ||
| "ActivityFragmentKoinScope", | ||
| "AndroidContextNotFromKoin", | ||
| "AnnotatedClassImplementsNestedInterface", | ||
| "AnnotationProcessorNotConfigured", | ||
| "CircularModuleDependency", | ||
| "CloseableWithoutOnClose", | ||
| "ConflictingBindings", | ||
| "ConstructorDslAmbiguousParameters", | ||
| "DeprecatedKoinApi", | ||
| "DuplicateBindingWithoutQualifier", | ||
| "EmptyModule", | ||
| "EnumQualifierCollision", | ||
| "ExcessiveCreatedAtStart", | ||
| "FactoryInScopeBlock", | ||
| "GenericDefinitionWithoutQualifier", | ||
| "GetConcreteTypeInsteadOfInterface", | ||
| "InjectedParamWithNestedGenericType", | ||
| "InvalidNamedQualifierCharacters", | ||
| "KoinAnnotationOnExtensionFunction", | ||
| "KoinInjectInPreview", | ||
| "KoinViewModelOutsideComposable", | ||
| "KtorApplicationKoinInit", | ||
| "KtorRequestScopeMisuse", | ||
| "KtorRouteScopeMisuse", | ||
| "LayerBoundaryViolation", | ||
| "MissingModuleAnnotation", | ||
| "MissingScopeClose", | ||
| "MissingScopedDependencyQualifier", | ||
| "MixingDslAndAnnotations", | ||
| "ModuleAsTopLevelVal", | ||
| "ModuleIncludesOrganization", | ||
| "NoGetOutsideModuleDefinition", | ||
| "NoGlobalContextAccess", | ||
| "NoInjectDelegate", | ||
| "NoKoinComponentInterface", | ||
| "NoKoinGetInApplication", | ||
| "OverrideInIncludedModule", | ||
| "ParameterTypeMatchesReturnType", | ||
| "PlatformImportRestriction", | ||
| "RememberKoinModulesLeak", | ||
| "ScopeAccessInOnDestroy", | ||
| "ScopeDeclareWithActivityOrFragment", | ||
| "ScopedDependencyOutsideScopeBlock", | ||
| "ScopedWithoutQualifier", | ||
| "SingleAnnotationOnObject", | ||
| "SingleForNonSharedDependency", | ||
| "StartKoinInActivity", | ||
| "TooManyInjectedParams", | ||
| "UnassignedQualifierInWithOptions", | ||
| "ViewModelAnnotatedAsSingle", | ||
| "ViewModelAsSingleton", | ||
| ], | ||
| usesTypeResolution: false, | ||
| tags: ["ruleset"], | ||
| }, |
There was a problem hiding this comment.
The entry is not in alphabetical position. According to case-insensitive alphabetical sorting, "detekt-rules-koin" should be placed between "Detekt Rule Authors" (around line 179) and "Doist detekt-rules" (around line 193), not after "UseInvokeForOperator". The comment at the end of the file (line 444) explicitly states "add your ruleset in alphabetical order."
Co-authored-by: Matthew Haughton <3flex@users.noreply.github.com>
Summary
Adds detekt-rules-koin to the marketplace — a Detekt extension with 51 rules for Koin 4.x.
usesTypeResolution: false)dev.androidbroadcast.rules.koin:detekt-koin4-rulesRule categories
Checklist
rulesetID matchesruleSetIdinRuleSetProviderusesTypeResolution: falsetags: ["ruleset"]