You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are a small Team of Devs with different OS (Linux, Mac, Windows) so we all have systems with different line endings.
Since we switched from 0.47.1 to ktlint-cli 1.3.0 the tool touches the line endings. I have searched for an option that just says: keep the line-endings as they are. But only the following are supported in the .editorconfig:
end_of_line = lf
end_of_line = crlf
end_of_line = cr
So what we have done is to create an .editorconfig_win/.editorconfig (as default for linux) /.editorconfig_mac with identical rulesets but differet eol.
The next problem occured: It seems if i run ktlint and if it finds any ".editorconfig" the settings of this file overwrites any passed editorconfig argument.
=>
If i run ktlint --editorconfig=.editorconfig_win -F
on my windows machine, all the files get LF ending instead of CRLF.
As a workaround every Dev just sets temporaly the correct line ending in the .editorconfig for formatting. This is a risk, they have to take care not to check in their eol-setting...
We need a "end_of_line = keep it " option
If a default .editorconfig file is found in the CWD it should not overwrite settings of a argument-passed editorconfig
Your Environment
Version of ktlint used: 1.3.0
Relevant parts of the .editorconfig settings: end_of_line = cr/crlf/lf
Operating System and version: Multiple Windows 11/10, Ubuntu 22.4 and some macos quatsch (i dont like macos :))
The text was updated successfully, but these errors were encountered:
Expected Behavior
We are a small Team of Devs with different OS (Linux, Mac, Windows) so we all have systems with different line endings.
Since we switched from 0.47.1 to ktlint-cli 1.3.0 the tool touches the line endings. I have searched for an option that just says: keep the line-endings as they are. But only the following are supported in the .editorconfig:
end_of_line = lf
end_of_line = crlf
end_of_line = cr
So what we have done is to create an .editorconfig_win/.editorconfig (as default for linux) /.editorconfig_mac with identical rulesets but differet eol.
The next problem occured: It seems if i run ktlint and if it finds any ".editorconfig" the settings of this file overwrites any passed editorconfig argument.
![grafik](https://private-user-images.githubusercontent.com/64078135/366353451-dafa525d-38ed-48e7-923a-d3c25134641e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4NjY2NTMsIm5iZiI6MTczOTg2NjM1MywicGF0aCI6Ii82NDA3ODEzNS8zNjYzNTM0NTEtZGFmYTUyNWQtMzhlZC00OGU3LTkyM2EtZDNjMjUxMzQ2NDFlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE4VDA4MTIzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThkZmFjMTAzYzM1YjQ5ODE4NWU0MDM0ZDVlYWI0MmVkMjdlNTY2ZmNiY2RmN2NkNmVlYjg5MDdiOGQwMjNkNTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.JcuJND06xm8YmfIGqE8YbLYoyY8p80DC9yP5f2PJXyA)
=>
If i run
ktlint --editorconfig=.editorconfig_win -F
on my windows machine, all the files get LF ending instead of CRLF.
As a workaround every Dev just sets temporaly the correct line ending in the .editorconfig for formatting. This is a risk, they have to take care not to check in their eol-setting...
Your Environment
.editorconfig
settings: end_of_line = cr/crlf/lfThe text was updated successfully, but these errors were encountered: