Comments (10)
Before closing this issue, should be great to add .editorconfig
for all styles (Google and Kotlinlang).
Personally, instead of having only one file with comments to change from one style to another, I think should be better to have 4 files:
- .editorconfig-default
- .editorconfig-dropbox
- .editorconfig-google-internal
- .editorconfig-kotlinlang
from ktfmt.
I should have time to have a crack at that this weekend.
from ktfmt.
Do you mean emit an .editorconfig
from the plugin? or store one in the plugin that matches the plugin's config?
from ktfmt.
Maintaining it as a standalone file people can download may be easier than making the plugin emit it on the fly, but either way would be useful.
Basically the idea is to make it easy to include editor settings in a project that uses ktfmt, such that the editor gets as close as possible to ktfmt's rules and ktfmt needs to make fewer changes. That's likely to be less error-prone than trying to tell people which editor settings to change manually.
from ktfmt.
I assume the target audience is users using an IDE other than IntelliJ, since there's a ktfmt plugin for IntelliJ?
from ktfmt.
The target audience I had in mind is actually IntelliJ users. To be clear, this is definitely a low-priority thing, but I'd want this for a few reasons:
- My experience is that there's often one person on a team who ends up not running ktfmt before committing code for whatever reason, so having the editor produce mostly-ktfmt-style code to begin with means that the subsequent cleanup commit won't churn the file's blame history as much.
- While I'm editing code, it's nice when the new code I'm typing looks similar to the existing ktfmt-formatted code. Otherwise I find myself hitting the Reformat hotkey pretty often to make everything line up.
- It will serve as a kind of machine-readable documentation of ktfmt's formatting rules.
from ktfmt.
from ktfmt.
Here's a hand-tweaked export of my IntelliJ settings; it isn't too far off, I think, but I am not confident I've gotten everything right (certainly not confident enough to want to submit it as a PR, but if you like, I can do that.)
from ktfmt.
from ktfmt.
@sgrimm, could you work on what @JavierSegoviaCordoba proposed? I think that is a good idea.
@JavierSegoviaCordoba, if you feel adventurous and want to take a stab at this, I'd be happy to help ship it.
from ktfmt.
Related Issues (20)
- Context receivers give `ParseError` HOT 2
- IDEA plugin is not published since 0.43 HOT 9
- Unstable formatting of file with a set of comments HOT 3
- @sample tags should not be moved within kdoc HOT 9
- Formatting creating lines longer than 100 characters HOT 5
- Unexpected removal of space after a comment HOT 2
- Annotation location on properties HOT 1
- 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 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 ktfmt.