is there a way to check line endings with ktlint? specifically, I'd like to ensure within the checking process that all files end with LF. I'm aware of some behavior during formatting that .editorconfig is respected (https://github.com/pinterest/ktlint/issues/225), but I'd like to have it verified during checking
s
Sha Sha Chu
03/10/2022, 4:00 PM
I think in our repo we just use git to enforce line endings
p
Paul Dingemans
03/12/2022, 1:55 PM
You seem to ask two different things.
First the line endings. When you you “.editorconfig” which is recommended, you can set the end_of_line property (see https://editorconfig.org/).
Secondly, the ending of the file with a LF. Ktlint does contain a rule which enforces the file to end with a blank line.
p
Piotr Krzemiński
03/12/2022, 2:17 PM
Sorry, I meant all lines should end with a LF
p
Paul Dingemans
03/12/2022, 2:18 PM
No problem. See remark about “.editorconfig”.
p
Piotr Krzemiński
03/13/2022, 6:55 PM
Should .editorconfig enforce proper behavior during checking (validation)? From what I tested it, this config doesn't influence checking
p
Paul Dingemans
03/14/2022, 8:44 PM
No that should be done by your editor, if it respects the .editorconfig