pinterest / ktlint

An anti-bikeshedding Kotlin linter with built-in formatter
https://pinterest.github.io/ktlint/
MIT License
6.23k stars 512 forks source link

function-naming triggers for Jetpack Compose #2333

Closed WildOrangutan closed 1 year ago

WildOrangutan commented 1 year ago

Expected Behavior

function-naming rule to not trigger for composable functions, that are meant to be capitalized. For example:

@Composable
fun MainScreen() {
    Text("Hello")
}

Is there any option, to exclude this rule, only for @Composable annotations maybe?

Observed Behavior

Lint fails, saying that MainScreen() should be named mainScreen()

Steps to Reproduce

Nothing special, just run lint with above code

Your Environment

Ktlint version: 1.0.0

rmarquis commented 1 year ago

This is fixed in ktlint 1.0.1.