- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 794
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
Update ktlint to v0.48.0 #5625
Update ktlint to v0.48.0 #5625
Conversation
This can be enabled again when this defect is fixed: pinterest/ktlint#1733
@@ -78,21 +77,20 @@ abstract class FormattingRule(config: Config) : Rule(config) { | |||
this.root = root | |||
positionByOffset = KtLintLineColCalculator | |||
.calculateLineColByOffset(KtLintLineColCalculator.normalizeText(root.text)) | |||
root.node.putUserData(KtLint.FILE_PATH_USER_DATA_KEY, root.name) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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())
@@ -77,6 +79,8 @@ formatting: | |||
active: true | |||
MaximumLineLength: | |||
active: false | |||
NoSemicolons: | |||
active: false # https://github.com/pinterest/ktlint/issues/1733 |
There was a problem hiding this comment.
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.
@@ -78,21 +77,20 @@ abstract class FormattingRule(config: Config) : Rule(config) { | |||
this.root = root | |||
positionByOffset = KtLintLineColCalculator | |||
.calculateLineColByOffset(KtLintLineColCalculator.normalizeText(root.text)) | |||
root.node.putUserData(KtLint.FILE_PATH_USER_DATA_KEY, root.name) |
There was a problem hiding this comment.
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())
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 |
There are three new rules that I haven't added wrappers for, since we seem to have the same ones in detekt already:
Also had to disable
NoSemicolons
rule on detekt's codebase because of pinterest/ktlint#1733 but I'm sure that will be fixed soon. When this is merged I'll open a tracking issue for that.