Skip to content
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

Diktat 2.0 changes newlines #1828

Closed
nulls opened this issue Nov 28, 2023 · 1 comment · Fixed by #1830
Closed

Diktat 2.0 changes newlines #1828

nulls opened this issue Nov 28, 2023 · 1 comment · Fixed by #1830
Assignees
Labels
bug Something isn't working
Milestone

Comments

@nulls
Copy link
Member

nulls commented Nov 28, 2023

After applying the diktatFix , the following changes are in source code:

warning: in the working copy of 'save-sandbox/src/main/kotlin/com/saveourtool/save/sandbox/storage/SandboxStorage.kt', LF will be replaced by CRLF the next time Git touches it
@nulls nulls added the bug Something isn't working label Nov 28, 2023
@nulls nulls added this to the 2.0.0 milestone Nov 28, 2023
@nulls nulls self-assigned this Nov 28, 2023
@nulls
Copy link
Member Author

nulls commented Nov 28, 2023

Looks like ktlint relates on .editorconfig as a source for endOfLine and lf is value by default.
Probably we should configure .editorconfig instead of changing end lines in formatted code: we get a formatted code as output of calling ktlint.

Also we can set editorConfigDefaults when KtLintRuleEngine is being created KtLintRuleEngine is created a single time, but end of line needs to be detected based on a file. So we can support only cases with system specific end of lines

nulls added a commit that referenced this issue Nov 28, 2023
### What's done:
- set `editorConfigDefaults` with `end_of_line` based on current system

It closes #1828
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant