-
-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Expected Behavior
Detekt and ktlint should push for the same indentation.
Observed Behavior
In the attached example detekt wants 12, while ktlint wants 16.
So one of these linters will complain, always.
Steps to Reproduce
- Enable File > Settings > Tools > detekt > Rules > Enable formatting (ktlint) rules in AndroidStudio
- Write code like
@Composable
fun Example(
icon: Painter,
text: String,
modifier: Modifier = Modifier,
) {
Row(
modifier =
modifier //!!
.fillMaxWidth() //!!
.height(50.dp), //!!
verticalAlignment = Alignment.CenterVertically,
) {...}}
- The lines marked above with
//!!
will be reported with bad indentation. If one tool (e.g. ktlint) is allowed to fix the indentation, the other (e.g. detekt) starts complaining and vice versa:
Context
I want a warning free code, both from ktlint and detekt.
Your Environment
- Version of detekt used: detekt plugin (in Android Studio): 2.4.1
- ktlint plugin (in AS): 0.24.1
- Version of Gradle used (if applicable): 8.5; Android Gradle plugin: 8.2.2
- Gradle scan link (add
--scan
option when running the gradle task): n/a - Operating System and version: Ubuntu Linux 22.04
- Link to your project (if it's a public repository): n/a
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working