Skip to content

Update ktlint to v0.48.0#5625

Merged
3flex merged 8 commits into
detekt:mainfrom
3flex:ktlint-0.48.0
Dec 17, 2022
Merged

Update ktlint to v0.48.0#5625
3flex merged 8 commits into
detekt:mainfrom
3flex:ktlint-0.48.0

Conversation

@3flex

@3flex 3flex commented Dec 16, 2022

Copy link
Copy Markdown
Member

There are three new rules that I haven't added wrappers for, since we seem to have the same ones in detekt already:

  • Class naming
  • Function naming
  • Property naming

Also had to disable NoSemicolons rule on detekt's codebase because of ktlint/ktlint#1733 but I'm sure that will be fixed soon. When this is merged I'll open a tracking issue for that.

@github-actions github-actions Bot added dependencies Pull requests that update a dependency file formatting rules labels Dec 16, 2022
@3flex 3flex mentioned this pull request Dec 16, 2022
1 task
this.root = root
positionByOffset = KtLintLineColCalculator
.calculateLineColByOffset(KtLintLineColCalculator.normalizeText(root.text))
root.node.putUserData(KtLint.FILE_PATH_USER_DATA_KEY, root.name)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value isn't read by any ktlint rules that we have wrappers for, so removing this line has no effect.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This key is going to be removed anyway

// TODO: Remove in KtLint 0.49
                rootNode.putUserData(KtLint.FILE_PATH_USER_DATA_KEY, code.filePath.toString())

Comment thread config/detekt/detekt.yml
MaximumLineLength:
active: false
NoSemicolons:
active: false # https://github.com/pinterest/ktlint/issues/1733

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to fast-follow on this since this is being addressed in Ktlint 0.48.1 according to the comments.

this.root = root
positionByOffset = KtLintLineColCalculator
.calculateLineColByOffset(KtLintLineColCalculator.normalizeText(root.text))
root.node.putUserData(KtLint.FILE_PATH_USER_DATA_KEY, root.name)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This key is going to be removed anyway

// TODO: Remove in KtLint 0.49
                rootNode.putUserData(KtLint.FILE_PATH_USER_DATA_KEY, code.filePath.toString())

@picklebento

Copy link
Copy Markdown
Member

There are three new rules that I haven't added wrappers for, since we seem to have the same ones in detekt already:

Class naming
Function naming
Property naming

I believe Detekt implementation for these rules is more flexible (Since ktlint is mostly on/off with limited configurability), hence I believe we should still add a wrapper rule for them (There can be cases where Detekt users turn off the detekt implementation and use ktlint). This can be a discussion / follow-up

@3flex 3flex merged commit 774468c into detekt:main Dec 17, 2022
@3flex 3flex deleted the ktlint-0.48.0 branch December 17, 2022 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file formatting rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants