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

Update dependency org.jmailen.gradle:kotlinter-gradle to v4 #4488

Merged
merged 14 commits into from
Dec 11, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Nov 18, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
org.jmailen.gradle:kotlinter-gradle 3.15.0 -> 4.5.0 age adoption passing confidence

Release Notes

jeremymailen/kotlinter-gradle (org.jmailen.gradle:kotlinter-gradle)

v4.5.0

Compare Source

  • Upgrade to ktlint 1.4.1
  • Note, now requires Kotlin version 2.0+

v4.4.1

Compare Source

v4.4.0

Compare Source

ktlint 1.3.0 introduces some significant formatting rule changes, so you may find applying this newer version will introduce a lot of changes.

v4.3.0

Compare Source

Upgrade to ktlint 1.2.1

v4.2.0

Compare Source

  • Upgrade to ktlint 1.1.1 (which also takes us through 1.1.0)
  • Upgrade various tooling and library versions

Note: compatibility matrix has upgraded to require minimum of Kotlin 1.9.20.

v4.1.1

Compare Source

Small release, but two important fixes:

v4.1.0

Compare Source

New feature to failBuildWhenCannotAutoFormat for the formatKotlin task - thanks @​acreddy9
See new configuration options here.

v4.0.1

Compare Source

Update to ktlint 1.0.1

v4.0.0

Compare Source

Upgrade to ktlint 1.0.0

v3.16.0

Compare Source

This release upgrades to ktlint 0.50.0.
Please read the linked release notes to learn about new features and fixes.


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the dependencies Pull requests that update a dependency file label Nov 18, 2024
osipxd
osipxd previously requested changes Nov 18, 2024
Copy link
Member

@osipxd osipxd left a comment

Choose a reason for hiding this comment

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

We should fix new rules violations before merging this

@osipxd osipxd force-pushed the renovate/major-ktlint branch from 0a98950 to 2c67639 Compare November 19, 2024 10:52
Copy link
Contributor Author

renovate bot commented Nov 19, 2024

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

@osipxd osipxd self-assigned this Nov 19, 2024
@osipxd osipxd force-pushed the renovate/major-ktlint branch from 2c67639 to 60befa6 Compare November 21, 2024 09:19
@osipxd osipxd mentioned this pull request Nov 26, 2024
@osipxd osipxd force-pushed the renovate/major-ktlint branch 5 times, most recently from 0429d45 to 6e27042 Compare December 9, 2024 15:27
@osipxd
Copy link
Member

osipxd commented Dec 9, 2024

Finished with fixing style problems here. Feel free to review this PR!
It's easier to review commit-by-commit.

@osipxd osipxd force-pushed the renovate/major-ktlint branch from 6e27042 to cf05f00 Compare December 9, 2024 18:11
.editorconfig Outdated
Comment on lines 17 to 23
ktlint_standard_annotation = disabled
ktlint_standard_class-naming = disabled
ktlint_standard_class-signature = disabled
ktlint_standard_comment-wrapping = disabled
ktlint_standard_condition-wrapping = disabled
ktlint_standard_filename = disabled
ktlint_standard_function-expression-body = disabled
ktlint_standard_function-signature = disabled
Copy link
Member

@osipxd osipxd Dec 9, 2024

Choose a reason for hiding this comment

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

Here you can find examples with findings for the disabled rules

ktlint_standard_no-wildcard-imports = disabled
ktlint_standard_property-naming = disabled
Copy link
Member

Choose a reason for hiding this comment

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

standard:property-naming

This rule doesn't like constants starting written in CamelCase. And we have a lot of such constants:

public object AuthScheme {
    public const val Basic: String = "Basic"

ktlint_code_style = intellij_idea
ktlint_standard_annotation = disabled
ktlint_standard_class-naming = disabled
ktlint_standard_class-signature = disabled
Copy link
Member

Choose a reason for hiding this comment

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

standard:class-signature

From official docs:

For code styles android_studio and intellij_idea this rule rewrites multiline class signature to a single line class signature in case the entire class signature fits on a single line by default. In case you want to leave it to the discretion of the developer to decider whether a single or a multiline class signature is used, please suppress or disable this rule.

ktlint_standard_condition-wrapping = disabled
ktlint_standard_filename = disabled
ktlint_standard_function-expression-body = disabled
ktlint_standard_function-signature = disabled
Copy link
Member

Choose a reason for hiding this comment

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

standard:function-signature

This one is similar to class-signature but for functions and with the same problems.

ktlint_standard_comment-wrapping = disabled
ktlint_standard_condition-wrapping = disabled
ktlint_standard_filename = disabled
ktlint_standard_function-expression-body = disabled
Copy link
Member

Choose a reason for hiding this comment

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

standard:function-expression-body

Actually, I like this rule for one-line expressions, but it forces expression body even for multiline expressions.

@@ -13,13 +13,23 @@ indent_size = 2
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
ij_kotlin_packages_to_use_import_on_demand = java.util.*, io.ktor.**

ktlint_code_style = intellij_idea
Copy link
Member

Choose a reason for hiding this comment

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

Use defaults from the Kotlin Coding Conventions

@e5l
Copy link
Member

e5l commented Dec 9, 2024

Enormous work! Good job on this, LGTM

@@ -47,16 +47,6 @@ fun NamedDomainObjectContainer<KotlinSourceSet>.jvmAndPosixTest(block: KotlinSou
block(sourceSet)
}

fun NamedDomainObjectContainer<KotlinSourceSet>.jvmAndNixMain(block: KotlinSourceSet.() -> Unit) {
Copy link
Member

Choose a reason for hiding this comment

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

Is it deleted because it isn't used?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, the entire source set was unused

Copy link
Member

@marychatte marychatte left a comment

Choose a reason for hiding this comment

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

Great work 🚀

Copy link
Contributor

@bjhham bjhham left a comment

Choose a reason for hiding this comment

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

ktlint_standard_function-expression-body = disabled
ktlint_standard_function-signature = disabled
ktlint_standard_if-else-bracing = enabled
ktlint_standard_if-else-wrapping = enabled
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't care for the if-else rules 👎

Copy link
Member

@osipxd osipxd Dec 11, 2024

Choose a reason for hiding this comment

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

The only reason why I've enabled these rules is that we've had only 19 violations of them. So it seems reasonable to enable them as we aligned to them anyway.

Let's leave the rules enabled and disable them if they get in the way.

@osipxd osipxd force-pushed the renovate/major-ktlint branch from cf05f00 to f195f0f Compare December 11, 2024 10:15
@osipxd osipxd enabled auto-merge (squash) December 11, 2024 10:15
@osipxd osipxd force-pushed the renovate/major-ktlint branch from f195f0f to 7f44fa2 Compare December 11, 2024 12:30
@osipxd osipxd force-pushed the renovate/major-ktlint branch from 7f44fa2 to 8007cdd Compare December 11, 2024 13:20
@osipxd osipxd merged commit 17839c5 into main Dec 11, 2024
14 of 16 checks passed
@osipxd osipxd deleted the renovate/major-ktlint branch December 11, 2024 14: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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants