Comments (11)
@greyhairredbear do you know if this is related to #420?
Unfortunately, not really. My original thought was that this might be because of different ktfmt versions, but according to the original post in the gradle plugin, this doesn't seem to be the case.
I can try if #420 produces the expected results.
UPDATE: @hick209 of course, you are correct, the @interface
is not valid Kotlin... @gino-m are you sure this is a .kt
file you are referencing here?
PS: @gino-m I suppose it would be helpful to also include the versions used in this post.
from ktfmt.
Just FYI: When using #420, the code stays unchanged (regardless of the formatting) due to it not being valid Kotlin. After removing the @interface
-portion, the output is the following:
/**
* Annotates view models to indicate that a single instance should be shared by all fragments in an
* activity. Only one instance of such view models will be created per activity by {@link
* ViewModelFactory#get(Fragment, Class)}.
*/
@Retention(RetentionPolicy.RUNTIME) public SharedViewModel {}
from ktfmt.
@hick209 So sorry, was moving too fast. That was Java - added a Kotlin example .
@greyhairredbear The formatting in the above snippet was produced by Android Studio ktfmt plugin 1.1.0.47, the Gradle plugin com.ncorti.ktfmt.gradle
version 0.17.0. Added these to the updated issue description and shared additional deltas in https://github.com/google/ground-android/pull/2412/files.
from ktfmt.
@greyhairredbear do you know if this is related to #420?
from ktfmt.
I tried to format you code here and it fails due to the @interface
there, as that's not valid Kotlin.
Could you revisit and share a piece of code where we could repro the issue?
from ktfmt.
Related Issues (20)
- Incorrect detection of unused import in Gradle Kotlin DSLs using new assignment operator HOT 1
- Update the pics in [demo](https://github.com/facebook/ktfmt#demo) HOT 4
- Publishing workflow is broken HOT 2
- ktfmt 0.45 is shipping against ancient milestone version of Kotlin HOT 2
- Parse error on empty enum with ';'
- Stop unwrapping wrapped function chaining HOT 1
- Kotlin rangeUntil ..< Syntax Throws Error HOT 1
- Cannot handle formatting `context` keyword HOT 3
- idea complains about deprecated method HOT 5
- KDoc: `@param` and `@property` sorted by type, not by position
- Continuation indent on delegating properties is missing HOT 1
- 0.47 trailing comma changes cause class definitions to be formatted weirdly HOT 2
- Formatting isn't idempotent, and repeated invocations produce bad comment formatting HOT 8
- ktfmt version 0.47 incompatible with spotless HOT 2
- Feature request: GraalVM artifacts HOT 1
- add trailing comma support to other non-google styles HOT 5
- Indentation level should be a command-line argument HOT 2
- Treat trailing Elvis operator as part of a call chain HOT 2
- Adding target jar to releases HOT 2
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 ktfmt.