https://github.com/androidbroadcast/koin-detekt
Detekt rules for Koin DI
https://github.com/androidbroadcast/koin-detekt
Last synced: 3 months ago
JSON representation
Detekt rules for Koin DI
- Host: GitHub
- URL: https://github.com/androidbroadcast/koin-detekt
- Owner: androidbroadcast
- License: other
- Created: 2026-02-11T12:53:15.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-02-23T20:42:39.000Z (3 months ago)
- Last Synced: 2026-02-24T02:59:01.776Z (3 months ago)
- Language: Kotlin
- Size: 588 KB
- Stars: 21
- Watchers: 0
- Forks: 0
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# detekt-rules-koin
[](https://github.com/androidbroadcast/Koin-Detekt/releases/latest)
[](https://central.sonatype.com/artifact/dev.androidbroadcast.rules.koin/detekt-koin4-rules)
[](https://github.com/androidbroadcast/Koin-Detekt/actions/workflows/pr-validation.yml)
[](https://opensource.org/licenses/Apache-2.0)
Detekt extension with 51 rules for Koin 4.x — enforces best practices and catches common anti-patterns via static analysis.
## Installation
```kotlin
dependencies {
detektPlugins("dev.androidbroadcast.rules.koin:detekt-koin4-rules:1.0.0")
}
```
## Rules
51 rules across 6 categories:
| Category | Rules |
|----------|-------|
| Service Locator | 5 |
| Module DSL | 14 |
| Scope Management | 8 |
| Platform | 8 |
| Architecture | 4 |
| Koin Annotations | 12 |
📖 [Complete Rule Documentation](docs/rules.md)
## Configuration
Add to `.detekt.yml`:
```yaml
koin-rules:
NoKoinComponentInterface:
active: true
allowedSuperTypes:
- 'Application'
- 'Activity'
SingleForNonSharedDependency:
active: true
namePatterns:
- '.*UseCase'
- '.*Command'
```
📖 [Configuration Guide](docs/configuration.md)
## Requirements
- Kotlin 2.0+
- Detekt 1.23.8+
- Koin 4.x
## License
Licensed under the [Apache License 2.0](https://opensource.org/licenses/Apache-2.0).