-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[JEWEL-920] Add Detekt Compose rules to the project #3161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rock3r
wants to merge
1
commit into
JetBrains:master
Choose a base branch
from
rock3r:sebp/JEWEL-920_add-detekt-compose-rules
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[JEWEL-920] Add Detekt Compose rules to the project #3161
rock3r
wants to merge
1
commit into
JetBrains:master
from
rock3r:sebp/JEWEL-920_add-detekt-compose-rules
+1,072
−919
Conversation
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
faogustavo
approved these changes
Aug 4, 2025
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/RadioButton.kt
Outdated
Show resolved
Hide resolved
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/ScrollableContainer.kt
Outdated
Show resolved
Hide resolved
DanielSouzaBertoldi
suggested changes
Aug 4, 2025
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/Dropdown.kt
Show resolved
Hide resolved
f87690a
to
4e6243c
Compare
DanielSouzaBertoldi
approved these changes
Aug 5, 2025
b69cce0
to
590a1b5
Compare
Ready to merge |
We now apply additional Compose rules to our Detekt checks. The rules are documented at https://mrmans0n.github.io/compose-rules/rules/ A couple of rules have been disabled as they do not apply to Jewel as a library. The rules JAR was added to the repository so that it can also be used by the IntelliJ Detekt plugin, and show issues in the IJ editor. This applies trivial fixes from the rules, leaving difficult ones for a later time (suppressed and filed tech debt issues to fix them). Notable changes from applying the rules: * Fixed a bug in `BasicLazyTree` where a derived state was not remembered. * Fixed a bug in `ButtonImpl` where the `onStateChange`, accessed in a `LaunchedEffect`, was not used as a key to the effect. We have recently fixed a similar bug in JEWEL-868. * Fixed the same kind of bug in `ListComboBox`. * Fixed the same kind of bug in `CircularProgressIndicator`. * Fixed several missing remember keys in `PopupMenu`'s `MenuContent`. * Fixed a bug in `ContextMenu` where the focus manager and input mode manager were not remembered. * Deprecated several mistakenly public APIs in Menu.kt, and made them to delegate to a now-private implementation, so the public one can be safely removed in the future. * Made sure there is no indication set by default, instead of the stock one provided by Compose. * Adjusted the signature of many internal composables. * Improved the SLC and tree samples in the showcase. * Added a simpler variant to Modifier.outline(). This also adds an artifact so that we get a JAR for our own Detekt rules plugin when the IDE is built from JPS.
590a1b5
to
0058820
Compare
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.
We now apply additional Compose rules to our Detekt checks. The rules are documented at https://mrmans0n.github.io/compose-rules/rules/
A couple of rules have been disabled as they do not apply to Jewel as a library. The rules JAR was added to the repository so that it can also be used by the IntelliJ Detekt plugin, and show issues in the IJ editor.
This applies trivial fixes from the rules, leaving challenging ones for a later time (suppressed and filed tech debt issues to fix them).
Notable changes from applying the rules:
BasicLazyTree
where a derived state was not rememberedButtonImpl
where theonStateChange
, accessed in aLaunchedEffect
, was not used as a key to the effectListComboBox
CircularProgressIndicator
PopupMenu
'sMenuContent
ContextMenu
where the focus manager and input mode manager were not rememberedMenu.kt
, and made them to delegate to a now-private implementation, so the public one can be safely removed in the futureModifier.outline()
ComboBox
implementations by making the string-based variantdelegate to slot-based one
This also adds an artefact configuration, so that we get a JAR for our own Detekt rules plugin when the IDE is built from JPS.
Release notes
Indication
has been set to a no-op implementation in both standalone and bridge, instead of the previous default implementation we inherited from Compose. We handle visual states separately from theIndication
API, and as such this would only cause visual issues when using certain modifiers (e.g.,selectable
)ComboBox
overload has changed in a breaking way by reordering its parametersNew features
Modifier.outline()
Bug fixes
BasicLazyTree
where the item background state was not properly rememberedListComboBox
where changing theitemKeys
parameter value would not be picked up by the component until it exited and re-entered the compositionCircularProgressIndicator
where changing theframeRetriever
parameter value would not be picked up by the component until it exited and re-entered the compositionPopupMenu
was over-remembering some internal stateDeprecated API
Menu.kt
that were left public by mistake so they can be made private as they should, in the future