Thank you for your interest in contributing. This project enforces structured concurrency in Kotlin through a compiler plugin, Detekt rules, Android Lint, IntelliJ inspections, and supporting tooling.
This project follows the Contributor Covenant. By participating, you agree to uphold it.
- Check existing issues — Search open issues before opening a new one.
- Open an issue first for larger changes — New rules, breaking changes, or cross-module refactors benefit from discussion before implementation.
- Fork and branch — Create a feature branch from
main. - Make focused changes — Keep pull requests scoped to one concern when possible.
- Run tests locally — CI must pass before merge.
- Open a pull request — Fill in the PR template and link related issues.
- JDK 21
- Kotlin 2.3+
- Gradle 8.0+ (wrapper included)
git clone https://github.com/santimattius/structured-coroutines.git
cd structured-coroutines
# Publish artifacts to local Maven for integration testing
./gradlew publishToMavenLocal
# Run all module tests
./gradlew test
# Core modules only (matches CI)
./gradlew :compiler:test :detekt-rules:test :lint-rules:test
# IntelliJ plugin compilation (matches CI)
./gradlew :intellij-plugin:compileKotlin :intellij-plugin:instrumentCode
# Detekt sample validation
./gradlew :sample-detekt:detekt| Module | Purpose |
|---|---|
compiler/ |
K2/FIR compiler plugin |
detekt-rules/ |
Detekt static analysis rules |
lint-rules/ |
Android Lint detectors |
intellij-plugin/ |
IntelliJ/Android Studio inspections and quick fixes |
gradle-plugin/ |
Gradle integration and profiles |
annotations/ |
@StructuredScope and related annotations |
sample/ |
Compiler rule compilation examples |
sample-detekt/ |
Detekt rule validation samples |
kotlin-coroutines-skill/ |
AI/agent skill and reference docs |
New rules should stay aligned with Best Practices
and the shared manifest in docs/rule-codes.yml.
When adding a rule, update as applicable:
- Rule implementation — Compiler checker, Detekt rule, Lint detector, and/or IntelliJ inspection.
docs/rule-codes.yml— Rule code, suppression IDs, and doc anchor.docs/SUPPRESSING_RULES.md— Suppression identifiers across layers.- Sample code — Example in
sample/and/orsample-detekt/. - Tests — Unit tests for the rule logic.
- Reference docs — Entry under
kotlin-coroutines-skill/references/when the rule maps to a best practice. - CHANGELOG.md — User-facing summary of the change.
Rule codes follow the pattern CATEGORY_NNN (e.g. SCOPE_001, FLOW_012).
- Follow Kotlin coding conventions.
- Match existing patterns in the module you are editing.
- Keep user-facing messages in
.propertiesbundles for i18n (see README i18n section). - Prefer structured concurrency in any new coroutine code (no
GlobalScope, norunBlockingin suspend functions).
- Tests pass locally (
./gradlew testor the relevant module tasks). - New/changed rules include tests and sample code where applicable.
- Documentation updated (
rule-codes.yml, module README, CHANGELOG as needed). - Commit messages describe the why, not only the what.
Please do not open public issues for security vulnerabilities. See SECURITY.md for responsible disclosure.
For usage questions, open a GitHub Discussion (if enabled) or an issue with the question label.
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.