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

Support tabs through .editorconfig #128

Closed
ebrowne72 opened this issue Dec 14, 2017 · 11 comments · Fixed by #841
Closed

Support tabs through .editorconfig #128

ebrowne72 opened this issue Dec 14, 2017 · 11 comments · Fixed by #841

Comments

@ebrowne72
Copy link

Our source uses tabs instead of spaces. Can ktlint have support for "indent_style = tab" in the .editorconfig?

And yes, I know you can unset the indent_style, but that will also allow indenting with spaces, which we don't want.

@vanniktech
Copy link
Contributor

I don't think we would want that. Also the Android Kotlin style guide forbid them.

@ebrowne72
Copy link
Author

Some people aren't writing Android code. Some people writing Android code use tabs. I think having the option is good.

@bjornmartensson
Copy link

The compiler decides what is legal syntax. It's productive for a team to all use the same coding standards so that everyone's code is more uniform and easier for everyone to read. I would love it if everyone used the official Kotlin style guide, but for various reasons all teams don't want to do that.

But if the syntax allows tabs, then why would a coding style checking tool not allow the same flexibility as the language itself? It seems this kind of restriction would have been better placed in the Kotlin compiler, and putting it in a coding style checking tool just means some people won't be able to use ktlint?

@blop
Copy link

blop commented Jan 31, 2019

Or wait for someone to fork klint and add support for tabs ?

@blop
Copy link

blop commented Jan 31, 2019

  • You already allow people to change the indent_size with values that are not considered good in the "Android Kotlin style guide".

And as @ebrowne72 said, Kotlin is not used only for Android related code.

possible values: number (e.g. 2), "unset" (makes ktlint ignore indentation completely)

indent_size=4
"makes ktlint ignore indentation completely" -> even tabs ?

@shyiko
Copy link
Collaborator

shyiko commented Feb 12, 2019

https://twitter.com/shyiko/status/1028740776191090688 (tldr: send a PR and we'll merge it in)

@jaredsburrows
Copy link
Contributor

@ebrowne72 What are you using now? Can you not use indent_style = "tab"?

@ebrowne72
Copy link
Author

@jaredsburrows I am not using ktlint at all because it doesn't support tabs. What I'm asking for is someone to add support for indent_style = "tab".

@erik-browne-emc
Copy link

The IndentationRule doesn't support it:

@Simon3
Copy link

Simon3 commented Apr 1, 2020

So still no one with enough motivation to make a PR for this? :(

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

Successfully merging a pull request may close this issue.

9 participants