Skip to content
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

compose:naming-check is not honored in subclasses #129

Closed
Goooler opened this issue Jul 3, 2024 · 1 comment
Closed

compose:naming-check is not honored in subclasses #129

Goooler opened this issue Jul 3, 2024 · 1 comment

Comments

@Goooler
Copy link

Goooler commented Jul 3, 2024

Describe the bug

Code sample:

import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier

sealed interface Screen {

  @Suppress("ktlint:compose:naming-check")
  @Composable
  fun content(modifier: Modifier)

  data object Main : Screen {
    @Composable
    override fun content(modifier: Modifier) {}
  }
}

run ktlint check:

Step 'ktlint' found problem in 'src/main/java/Screen.kt':
Error on line: 12, column: 18
rule: compose:naming-check
Composable functions that return Unit should start with an uppercase letter.
They are considered declarative entities that can be either present or absent in a composition and therefore follow the naming rules for classes.

To Reproduce

Try with the sample above.

Expected behavior

No warning thrown like in AS

image
@Goooler Goooler closed this as not planned Won't fix, can't repro, duplicate, stale Jul 3, 2024
@Goooler
Copy link
Author

Goooler commented Jul 3, 2024

Wrongly filed to this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant