Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding --dropbox-style option to ktfmt (has workaround) #641

Closed
franvis opened this issue Jul 9, 2020 · 3 comments
Closed

Adding --dropbox-style option to ktfmt (has workaround) #641

franvis opened this issue Jul 9, 2020 · 3 comments

Comments

@franvis
Copy link
Contributor

franvis commented Jul 9, 2020

ktfmt uses 2 line indentation by default. The way to move this to 4 is to apply the option --dropbox-style when running it. Is there a way to pass this option through spotless?

@nedtwigg
Copy link
Member

nedtwigg commented Jul 9, 2020

There is not currently, but it would be easy to add. Here is how it works for google-java-format's AOSP feature.

An easy workaround is this:

ktfmt()
indentWithTabs(2)   // convert leading spaces to tabs at (2 spaces)=tab
indentWithSpaces(4) // convert leading tabs to spaces at tab=(4 spaces)

@nedtwigg nedtwigg changed the title Adding --dropbox-style option to ktfmt Adding --dropbox-style option to ktfmt (has workaround) Jul 9, 2020
@franvis
Copy link
Contributor Author

franvis commented Jul 10, 2020

Hello @nedtwigg. Thanks for the quick reply. I created a PR to add the option to the step, would you mind taking a look at it?

@nedtwigg
Copy link
Member

Published in plugin-gradle 5.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants