Skip to content

Fix indent issues with continuation indent#4103

Merged
3flex merged 1 commit intomainfrom
define-continuation-indent
Sep 17, 2021
Merged

Fix indent issues with continuation indent#4103
3flex merged 1 commit intomainfrom
define-continuation-indent

Conversation

@BraisGabin
Copy link
Copy Markdown
Member

I don't know if I'm the only one that when there are some continuation indents in a file, if I autoformat them with IntelliJ they are indented with 8 spaces and when that code is pushed the ktlint rules complain about it.

This PR fixes that. It defines the desired indent so IntelliJ and ktlint are aligined.

@BraisGabin BraisGabin added the housekeeping Marker for housekeeping tasks and refactorings label Sep 11, 2021
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 11, 2021

Codecov Report

Merging #4103 (d78cd76) into main (e0aed91) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##               main    #4103   +/-   ##
=========================================
  Coverage     83.58%   83.58%           
  Complexity     3187     3187           
=========================================
  Files           459      459           
  Lines          9101     9101           
  Branches       1772     1772           
=========================================
  Hits           7607     7607           
  Misses          561      561           
  Partials        933      933           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e0aed91...d78cd76. Read the comment docs.

@3flex
Copy link
Copy Markdown
Member

3flex commented Sep 12, 2021

You're not alone, I've also noticed this - but isn't this just changing the IntelliJ config to make ktlint happy? It should be the other way around. I think ktlint has problems with continuation indents so my preference would be to turn off that rule if it's not working correctly instead of changing the default IntelliJ code style.

@BraisGabin
Copy link
Copy Markdown
Member Author

You're not alone, I've also noticed this - but isn't this just changing the IntelliJ config to make ktlint happy? It should be the other way around. I think ktlint has problems with continuation indents so my preference would be to turn off that rule if it's not working correctly instead of changing the default IntelliJ code style.

Well, that depends if we want to have continuation indentation of size 8 or 4. I prefer them to be of size 4. And because, right now, all the code uses identation of size 4 (because of ktlint) I think that it's ok to continue with indent of 4.

@3flex 3flex merged commit cbdb460 into main Sep 17, 2021
@3flex 3flex deleted the define-continuation-indent branch September 17, 2021 10:45
@BraisGabin BraisGabin added this to the 1.19.0 milestone Sep 17, 2021
@cortinico cortinico changed the title Fix indent issues with continaution indent Fix indent issues with continuation indent Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

housekeeping Marker for housekeeping tasks and refactorings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants