Skip to content

Commit a11730c

Browse files
committed
chore: update detekt.yml with comments
1 parent 5af22b0 commit a11730c

File tree

1 file changed

+70
-8
lines changed

1 file changed

+70
-8
lines changed

config/detekt/detekt.yml

Lines changed: 70 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,42 +1074,89 @@ Compose:
10741074
active: true
10751075
ComposableNaming:
10761076
active: true
1077+
# -- You can optionally disable the checks in this rule for regex matches against the composable name (e.g. molecule presenters)
1078+
# allowedComposableFunctionNames: .*Presenter,.*MoleculePresenter
10771079
ComposableParamOrder:
10781080
active: true
1081+
# -- You can optionally have a list of types to be treated as lambdas (e.g. typedefs or fun interfaces not picked up automatically)
1082+
# treatAsLambda: MyLambdaType
10791083
CompositionLocalAllowlist:
10801084
active: true
1085+
# -- You can optionally define a list of CompositionLocals that are allowed here
1086+
# allowedCompositionLocals: LocalSomething,LocalSomethingElse
10811087
CompositionLocalNaming:
10821088
active: true
10831089
ContentEmitterReturningValues:
10841090
active: true
1085-
ContentSlotReused:
1086-
active: true
1091+
# -- You can optionally add your own composables here
1092+
# contentEmitters: MyComposable,MyOtherComposable
10871093
ContentTrailingLambda:
10881094
active: true
1095+
# -- You can optionally have a list of types to be treated as lambdas (e.g. typedefs or fun interfaces not picked up automatically)
1096+
# treatAsLambda: MyLambdaType
1097+
# -- You can optionally have a list of types to be treated as composable lambdas (e.g. typedefs or fun interfaces not picked up automatically).
1098+
# -- The difference with treatAsLambda is that those need `@Composable` MyLambdaType in the definition, while these won't.
1099+
# treatAsComposableLambda: MyComposableLambdaType
1100+
ContentSlotReused:
1101+
active: true
1102+
# -- You can optionally have a list of types to be treated as composable lambdas (e.g. typedefs or fun interfaces not picked up automatically).
1103+
# -- The difference with treatAsLambda is that those need `@Composable` MyLambdaType in the definition, while these won't.
1104+
# treatAsComposableLambda: MyComposableLambdaType
10891105
DefaultsVisibility:
10901106
active: true
10911107
LambdaParameterEventTrailing:
10921108
active: true
1109+
# -- You can optionally add your own composables here
1110+
# contentEmitters: MyComposable,MyOtherComposable
1111+
# -- You can add composables here that you don't want to count as content emitters (e.g. custom dialogs or modals)
1112+
# contentEmittersDenylist: MyNonEmitterComposable
10931113
LambdaParameterInRestartableEffect:
10941114
active: true
1115+
# -- You can optionally have a list of types to be treated as lambdas (e.g. typedefs or fun interfaces not picked up automatically)
1116+
# treatAsLambda: MyLambdaType
10951117
Material2:
1096-
active: false
1118+
active: false # Opt-in, disabled by default. Turn on if you want to disallow Material 2 usages.
1119+
# -- You can optionally allow parts of it, if you are in the middle of a migration.
1120+
# allowedFromM2: icons.Icons,TopAppBar
10971121
ModifierClickableOrder:
10981122
active: true
1123+
# -- You can optionally add your own Modifier types
1124+
# customModifiers: BananaModifier,PotatoModifier
10991125
ModifierComposed:
11001126
active: true
1127+
# -- You can optionally add your own Modifier types
1128+
# customModifiers: BananaModifier,PotatoModifier
11011129
ModifierMissing:
11021130
active: true
1131+
# -- You can optionally control the visibility of which composables to check for here
1132+
# -- Possible values are: `only_public`, `public_and_internal` and `all` (default is `only_public`)
1133+
# checkModifiersForVisibility: only_public
1134+
# -- You can optionally add your own Modifier types
1135+
# customModifiers: BananaModifier,PotatoModifier
1136+
# -- You can suppress this check in functions annotated with these annotations
1137+
# ignoreAnnotated: ['Potato', 'Banana']
11031138
ModifierNaming:
11041139
active: true
1140+
# -- You can optionally add your own Modifier types
1141+
# customModifiers: BananaModifier,PotatoModifier
11051142
ModifierNotUsedAtRoot:
11061143
active: true
1144+
# -- You can optionally add your own composables here
1145+
# contentEmitters: MyComposable,MyOtherComposable
1146+
# -- You can optionally add your own Modifier types
1147+
# customModifiers: BananaModifier,PotatoModifier
11071148
ModifierReused:
11081149
active: true
1150+
# -- You can optionally add your own Modifier types
1151+
# customModifiers: BananaModifier,PotatoModifier
11091152
ModifierWithoutDefault:
11101153
active: true
11111154
MultipleEmitters:
11121155
active: true
1156+
# -- You can optionally add your own composables here that will count as content emitters
1157+
# contentEmitters: MyComposable,MyOtherComposable
1158+
# -- You can add composables here that you don't want to count as content emitters (e.g. custom dialogs or modals)
1159+
# contentEmittersDenylist: MyNonEmitterComposable
11131160
MutableParams:
11141161
active: true
11151162
MutableStateAutoboxing:
@@ -1118,19 +1165,34 @@ Compose:
11181165
active: true
11191166
ParameterNaming:
11201167
active: true
1168+
# -- You can optionally have a list of types to be treated as lambdas (e.g. typedefs or fun interfaces not picked up automatically)
1169+
# treatAsLambda: MyLambdaType
1170+
# -- You can optionally add your allowed lambda names (e.g., usages from the past found in the official Compose code)
1171+
# allowedLambdaParameterNames: onSizeChanged, onGloballyPositioned
11211172
PreviewAnnotationNaming:
11221173
active: true
11231174
PreviewNaming:
1124-
active: false
1175+
active: false # Opt-in, disabled by default.
1176+
# -- You can optionally configure the naming strategy for previews.
1177+
# -- Possible values are: `suffix`, `prefix`, `anywhere`. By default, it will be `suffix`.
1178+
# previewNamingStrategy: suffix
11251179
PreviewPublic:
11261180
active: true
1127-
RememberContentMissing:
1128-
active: true
11291181
RememberMissing:
11301182
active: true
1183+
RememberContentMissing:
1184+
active: true
11311185
UnstableCollections:
1132-
active: false
1186+
active: false # Opt-in, disabled by default. Turn on if you want to enforce this (e.g. you have strong skipping disabled)
11331187
ViewModelForwarding:
1134-
active: false
1188+
active: true
1189+
# -- You can optionally use this rule on things other than types ending in "ViewModel" or "Presenter" (which are the defaults). You can add your own via a regex here:
1190+
# allowedStateHolderNames: .*ViewModel,.*Presenter
1191+
# -- You can optionally add an allowlist for Composable names that won't be affected by this rule
1192+
# allowedForwarding: .*Content,.*FancyStuff
1193+
# -- You can optionally add an allowlist for ViewModel/StateHolder names that won't be affected by this rule
1194+
# allowedForwardingOfTypes: PotatoViewModel,(Apple|Banana)ViewModel,.*FancyViewModel
11351195
ViewModelInjection:
11361196
active: true
1197+
# -- You can optionally add your own ViewModel factories here
1198+
# viewModelFactories: hiltViewModel,potatoViewModel

0 commit comments

Comments
 (0)