- Merge
ModifierParameterPosition
rule into theComposableParametersOrdering
rule. After upgrading to the new version of this ruleset,ModifierParameterPosition
should be removed fromdetekt-config.yml
file - Add support for building fat jars
- Bugfixes
-
Several rules (
ReusedModifierInstance
,UnnecessaryEventHandlerParameter
) were switched to run only when Detekt is working in a type resolution mode. This is required to make these rules more robust and have less false positives (such as #5, #13). Expect more rules in this ruleset to support only running in the type resolution mode -
New experimental rule:
ConditionCouldBeLifted
It will detect cases when if-condition inside a composable layout call could be "lifted up" and the whole call could be moved into that conditional expression, for example:
Column { if (x == 3) { Text("1") Text("2") } }
could be turned into
if (x == 3) { Column { Text("1") Text("2") } }
At the moment it tries to be extra careful to avoid reporting any potentially side-effecting code (for example if
Column
in the example above would have someModifier
affecting a parent layout, this conditional-lifting change wouldn't be correct), and by being "extra" careful it can miss some potential cases for optimisation.This may be improved in future.
-
Bug fixes
- New rule:
ComposeFunctionName
ensures that Composable functions which return Unit should start with upper-case while the ones that return a value should start with lower case - Improve
ReusedModifierInstance
to detekt more cases, now it works correctly for cases when a composable call is wrapped in conditional (and other expressions)
- Ignore composable functions in interfaces/abstract classes for
MissingModifierDefaultValue
(#11)
- New rule:
TopLevelComposableFunctions
ensures that all composable functions are top-level functions (disabled by default) - Ignore overridden functions in
MissingModifierDefaultValue
(#11) - Fix exception in UnnecessaryEventHandlerParameter (#14)
- New rule:
ComposableParametersOrdering
suggests separating required an optional parameters of the composable function into groups - New rule:
ModifierDefaultValue
ensures thatmodifier
parameter has a correct default value - New rule:
MissingModifierDefaultValue
checks ifmodifier
default value is specified - Improved error messages (#2)
- Fixed false positive in
ComposableEventParameterNaming
(#6)
- Update
ModifierParameterPosition
rule to better follow Compose style:modifier
parameter should be a first optional parameter, i.e. it should come after required parameters and before optional parameters
- Initial release