-
Notifications
You must be signed in to change notification settings - Fork 508
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
Turn insert_final_newline on by default #103
Comments
Hi @egor-n You can enable it by adding this to your .editorconfig [*.{kt,kts}]
insert_final_newline=true (we should probably turn it on by default, though) |
I should have thought of that. Thank you! |
No worries. Documentation wasn't very clear. If you don't mind I'll keep this ticket open until insert_final_newline is set to true by default. |
Right now it would not fail if there are two new lines at the end of a file. I guess that could be optimized, right? |
@vanniktech 2 or more blank lines should trigger "Needless blank line(s)" error. If it doesn't please submit a bug report. |
There you go #108 |
Instead of enabling this option by default I went with improving ktlint's .editorconfig support by automatically falling back to "[*]" for property resolution. This way people who have .editoconfig with "not enabled unless .editorconfig says otherwise" behavior is currently due to the fact that neither Jetbrains's nor Google's styleguide says anything about newline at the end of file. I'll try to clarify it before making insert_final_newline on by default.
|
Would love to see this enabled by default, especially because git diff warns about this. (A lot of tooling warns about it, actually!) |
What do you think about introducing the "file should end with a newline" rule?
Here's the Checkstyle rule for this.
The text was updated successfully, but these errors were encountered: