Skip to content

Commit 57d27f3

Browse files
committed
update readme
1 parent f869b6d commit 57d27f3

File tree

3 files changed

+48
-23
lines changed

3 files changed

+48
-23
lines changed

README.md

Lines changed: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,44 @@ plugins {
3131
2. Enable and configure your desired features. For example:
3232
```kotlin
3333
vkompose {
34-
skippabilityCheck = true
34+
skippabilityCheck = true
35+
// or
36+
skippabilityCheck {
37+
// For more see
38+
// https://android-review.googlesource.com/c/platform/frameworks/support/+/2668595
39+
// https://issuetracker.google.com/issues/309765121
40+
stabilityConfigurationPath = "/path/file.config"
41+
42+
// since 0.6 if strong skipping feature of Compose Compiler is enabled
43+
strongSkippingEnabled = true
3544
// or
36-
skippabilityCheck {
37-
// For more see
38-
// https://android-review.googlesource.com/c/platform/frameworks/support/+/2668595
39-
// https://issuetracker.google.com/issues/309765121
40-
stabilityConfigurationPath = "/path/file.config"
45+
strongSkipping {
46+
// Fail compilation if there is any problem with strong skipping mode
47+
strongSkippingFailFastEnabled = false // false by default
4148
}
49+
}
4250

43-
recompose {
44-
isHighlighterEnabled = true
45-
isLoggerEnabled = true
46-
// or
47-
logger {
48-
logModifierChanges = true // true by default since 0.5
49-
logFunctionChanges = true // true by default since 0.5. log when function arguments (like lambdas or function references) of composable function are changed
50-
}
51+
recompose {
52+
isHighlighterEnabled = true
53+
isLoggerEnabled = true
54+
// or
55+
logger {
56+
// true by default since 0.5
57+
// log modifier arguments changes
58+
logModifierChanges = true
59+
// true by default since 0.5
60+
// log when function arguments (like lambdas or function references) of composable function are changed
61+
logFunctionChanges = true
5162
}
63+
}
5264

53-
testTag {
54-
isApplierEnabled = true
55-
isDrawerEnabled = false
56-
isCleanerEnabled = false
57-
}
65+
testTag {
66+
isApplierEnabled = true
67+
isDrawerEnabled = false
68+
isCleanerEnabled = false
69+
}
5870

59-
sourceInformationClean = true
71+
sourceInformationClean = true
6072
}
6173
```
6274
3. Enable some plugins in your application code
@@ -127,8 +139,10 @@ And check logs with tag "RecomposeLogger". This already looks like the [Rebugger
127139

128140
### IDEA Plugin
129141
The IDEA plugin currently offers two features:
130-
- Error for unskippable functions and unstable parameters
131-
![vkcompose-idea-plugin-skippability-error.gif](art/vkcompose-idea-plugin-skippability-error.gif)
142+
- Skippability checks
143+
- Show a error for a unskippable function with unstable parameters
144+
- Show a warning or error for a function in which parameters are compared by reference (if strong skipping is enabled)
145+
![vkcompose-idea-plugin-skippability-error.gif](art/vkcompose-idea-plugin-skippability-error.gif)
132146

133147
- Marker for generated test tag values
134148
![vkcompose-idea-plugin-test-tag-marker.png](art/vkcompose-idea-plugin-test-tag-marker.png)
@@ -152,7 +166,18 @@ vkompose:
152166
NonSkippableComposable:
153167
active: true
154168
ignoredClasses: [ 'kotlin.*', 'my.clazz.Data' ]
169+
170+
# since 0.6
171+
# It's usually the same thing as NonSkippableComposable, but the name is more correct for strong skip mode
172+
ParamsComparedByRef:
173+
active: true
174+
ignoredClasses: [ 'kotlin.*', 'my.clazz.Data' ]
155175
```
156176
177+
### Notes
178+
#### Strong skipping problems suppression since 0.6
179+
In the compiler plugin, detector rules and plugin functions, ideas can be suppressed by either of the suppressions: NonSkippableComposable or ParamsComparedByRef.
180+
The NonSkippableComposable suppression will be removed in the future. For now, if strong skip is enabled, the idea plugin will mark NonSkippableComposable as unused and you can easily switch to ParamsComparedByRef
181+
157182
### Known issues
158183
- Idea plugin cannot draw a test tag marker for functions from other libraries if they have a default Modifier value and Modifier is not explicitly passes as an argument. For more see [KTIJ-27688](https://youtrack.jetbrains.com/issue/KTIJ-27688/Quick-documentation-shows-COMPILEDCODE-instead-of-the-real-default-value-for-compiled-code-with-sources)
447 KB
Loading

rules/detekt/src/main/kotlin/com/vk/detekt/compose/NonSkippableComposable.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class NonSkippableComposable(config: Config) : Rule(config) {
3535

3636
if (result !is SkippabilityResult.Unstable) return
3737
// backward compatibility
38-
if (function.isSuppressedBy("NonSkippableComposable", emptySet())) return
38+
if (function.isSuppressedBy("ParamsComparedByRef", emptySet())) return
3939

4040
Reporter.reportSkippabilitySmells(this, "Non skippable composable function", function, result)
4141
}

0 commit comments

Comments
 (0)