Comments (3)
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.
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.
Opened #2637.
from ktlint.
Related Issues (20)
- Ignore comments in imports when formatting HOT 8
- Promote experimental rules
- operator get with lambda: incorrect error
- ktlint_function_signature_body_expression_wrapping configuration doesn't work via .editorconfig HOT 2
- Can't Suppress individual wildcard import HOT 1
- Exception in `standard:argument-list-wrapping` when last line has tralling space and next line contains function call HOT 11
- [1.3.0] Running `-format` adds extra spaces to class & function definition HOT 4
- [1.3.0] Data class comments break indentation formatting HOT 3
- [1.3.0] Constructor overloads are incorrectly formatted HOT 1
- Improve quality control whether formatted code can still be compiled
- Remove SDKMan
- Unstable format results with anonymous function HOT 2
- Indentation error on malformed formatter closing tag
- Imports only used in blocks which may not be formatted are reported as unused
- Restrict import package HOT 1
- Add copy/paste enable/disable lines for each rule HOT 3
- ktlint has become too opinionated HOT 38
- No args constructor can be improperly removed HOT 1
- The class-signature rule wrong wrapping in 1.3.0. HOT 2
- Single-line chain method calls with operator HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ktlint.