Repository navigation
Make swing-ui-detekt self-contained: its own rule sets replace Android Lint - #47
Merged
Ivan Matkov (MatkovIvan) merged 8 commits intoNov 19, 2026
Conversation
Ivan Matkov (MatkovIvan)
force-pushed
the
ivan.matkov/self-contained-static-analysis
branch
2 times, most recently
from
November 18, 2026 19:47
b15b7dd to
3bbfa45
Compare
…rule API A rule written against detekt's Rule class runs nowhere else. Rules implement ComposeSwingRule, a visitor API free of detekt types, and one adapter in the detekt package runs them, so another host can run the same rules. Every existing rule moves onto the API with unchanged findings, and detekt.yml forbids a detekt import in the rules package.
Ivan Matkov (MatkovIvan)
force-pushed
the
ivan.matkov/self-contained-static-analysis
branch
2 times, most recently
from
November 19, 2026 12:56
9249626 to
d432215
Compare
… rule sets Consumers copy a Compose block into their detekt.yml to point compose-rules at this library's types, and the IDE cannot run those rules. The library adapts compose-rules' host-neutral visitors as its own rules with the library's types built in and ports its eight detekt-only checks and their tests onto the rule API, so a consumer needs no compose-rules detekt artifact or configuration. The catalog entry io.nlopez.compose.rules:detekt becomes common-detekt, still at 0.6.8. Flagged call sites are fixed or carry a reasoned suppression: Canvas drawing slot, two modifier factories.
Adds the shared helpers forked from androidx compose/lint/common and forks the RememberReturnType, OpaqueUnitKey and RememberInComposition detectors onto the host-neutral rule API, registered in the compose-runtime rule set with their issue ids, messages and test cases. The fixtures source set compiles against androidx.compose.runtime. Test windows take their state from rememberWindowState.
…report Forks androidx's ProduceState, ComposableCoroutineCreation and ComposableFlowOperator detectors onto the host-neutral rule API, registered in the compose-runtime rule set with their issue ids, messages and test cases.
…port Forks androidx's AutoboxingStateValueProperty, ComposableStateFlowValue, MutableCollectionMutableState and FrequentlyChangingValue detectors onto the host-neutral rule API, registered in the compose-runtime rule set with their issue ids, messages and test cases.
…cks report Forks androidx's RetainDetector and RememberSaveableDetector onto the host-neutral rule API, registered in the compose-runtime rule set with their issue ids, messages and test cases. The catalog gains androidx.compose.runtime:runtime-retain; the test classpath gains runtime-retain and runtime-saveable, and the fixtures classpath runtime-retain.
Forks androidx's ComposableLambdaParameterDetector with its issue ids, messages and test cases, and adds a rule that checks a constant argument against its parameter's declared IntRange or FloatRange, for Gradle consumers and in the IDE. RestrictedApi ports androidx's RestrictToDetector; without Maven coordinates, every library scope means declared outside the module under analysis. The test and fixtures classpaths gain androidx.annotation.
Android Lint hosted only the Compose runtime checks and the Range, RestrictedApi and VisibleForTests contracts. The library's rule sets report the Compose runtime contracts, declared ranges and restricted APIs, including APIs restricted to tests, so the standalone Lint plugin, its checks dependency and its configuration leave the build. Rule sets and implementation packages follow the APIs they check.
Ivan Matkov (MatkovIvan)
force-pushed
the
ivan.matkov/self-contained-static-analysis
branch
from
November 19, 2026 20:27
d432215 to
113925e
Compare
Ivan Matkov (MatkovIvan)
deleted the
ivan.matkov/self-contained-static-analysis
branch
November 19, 2026 20:43
Ivan Matkov (MatkovIvan)
temporarily deployed
to
github-pages
November 19, 2026 20:53 — with
GitHub Actions
Inactive
This branch was previously deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
swing-ui-detektexposesComposeSwingRule,ComposeSwingRuleReporter,ComposeSwingRuleConfig, andComposeSwingRuleSetsfor hosts that analyze Kotlin PSI.androidx-annotationschecks range, size, restricted access, and visibility for tests.compose-runtimechecks state, effects, and composable declarations.SwingModifier,SwingNode, andMenuNode.staticAnalysisruns with type resolution and treats warnings as build failures.