Git Product home page Git Product logo

Comments (3)

paul-dingemans avatar paul-dingemans commented on August 16, 2024

Ktlint is following the recommendations of Android Kotlin Style Guide when using code_style android_studio.

Based on Baseline style guidelines of Jetpack Compose you should use default kotlin coding style (code_style = intellij_idea). But this results in same violation.

The exception for Singletons, constants, sealed class and enum class values defined in Jetpack Compose can best be dealt with by disabling this rule in the .editorconfig. Defining a separate code style for Jetpack Compose is not something that I consider at this moment.

from ktlint.

mxalbert1996 avatar mxalbert1996 commented on August 16, 2024

Based on Baseline style guidelines of Jetpack Compose you should use default kotlin coding style (code_style = intellij_idea). But this results in same violation.

Right. I tried in IntelliJ IDEA and it's not reported as well, so this as a conflict between ktlint and IntelliJ IDEA.
What is worse is that suppressing the rule using @Suppress("ConstPropertyName") results in a warning ("Redundant suppression") in the IDE.
I guess disabling the rule is the only way.

Defining a separate code style for Jetpack Compose is not something that I consider at this moment.

Understandable. Disabling the rule is what I'm doing now, but that also disables the linting of other non-constant properties.
It would be great if the naming rule for constants can be separated so that I can disable that rule only.

from ktlint.

mxalbert1996 avatar mxalbert1996 commented on August 16, 2024

Opened #2637.

from ktlint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.