-
Notifications
You must be signed in to change notification settings - Fork 503
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
Max line length #47
Comments
Hi @Nycto. I'm not sure this is something that can be part of the standard ruleset (while I try to stay within 120 characters myself). But here are some of the options that you might want to consider:
|
On the other hand we could make it part of the ktlint and enable it whenever max_line_length is explicitly set for kt/kts files. |
I suppose it depends on what your goals with this project are. Do you have any tenants you're working with to help you decide whether a rule belomgs in the standard set? For example, if you told me "All Kotlin files should feel like they were written by the same person", I could make a good case for this. But I would have a harder time with something like "Kotlin files should be as short and noise free as possible". |
Place where kotlin code style stuff is discussed: https://github.com/yole/kotlin-style-guide Perhaps pose this question here and let the community come to some sort of consensus. |
In my rule I also excluded imports since they can't be broken up and some class names are really long (especially in libraries we don't control). Imports are always folded away in IntelliJ anyways. Does ktlint's implementation ignore them? |
@mhlz now it does :) (both package & import directives) |
@shyiko Is it possible to ignore max line length for kotlin raw strings? |
@alashow yes, please check this section of project readme: https://github.com/pinterest/ktlint#how-do-i-suppress-an-error-for-a-lineblockfile If it will not work for you, please open a new issue. |
I would like to enforce a maximum line length on the files being linted. I'm partial to 100 characters, or even 120.
The text was updated successfully, but these errors were encountered: