is there a way to check line endings with ktlint? ...
# ktlint
p
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
I think in our repo we just use git to enforce line endings
p
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
Sorry, I meant all lines should end with a LF
p
No problem. See remark about “.editorconfig”.
p
Should .editorconfig enforce proper behavior during checking (validation)? From what I tested it, this config doesn't influence checking
p
No that should be done by your editor, if it respects the .editorconfig