Skip to content

Deprecate TrailingComma as it's now split in two rules#5423

Merged
BraisGabin merged 2 commits intomainfrom
nc/TrailingComma
Oct 23, 2022
Merged

Deprecate TrailingComma as it's now split in two rules#5423
BraisGabin merged 2 commits intomainfrom
nc/TrailingComma

Conversation

@cortinico
Copy link
Copy Markdown
Member

When we bumped KtLint we effectively deprecated a rule TrailingComma, but we never updated the deprecation.properties file for it. Here I'm doing it.

@picklebento
Copy link
Copy Markdown
Member

I think I run into the same problem when adding the rule to deprecation.properties.


* What went wrong:
Execution failed for task ':detekt-generator:verifyGeneratorOutput'.
> The default-detekt-config.yml is not up-to-date. You can execute the generateDocumentation Gradle task to update it and commit the changed files.

It fails the check because these are not deprecated, but rather removed.
I believe we should be fine without update deprecation.properties because TrailingComma is highly visible when our users upgrade to newer versions of detekt

@cortinico
Copy link
Copy Markdown
Member Author

It fails the check because these are not deprecated, but rather removed.
I believe we should be fine without update deprecation.properties because TrailingComma is highly visible when our users upgrade to newer versions of detekt

Yup you're right. Still it should be possible to give the user an informative message, no?

@BraisGabin
Copy link
Copy Markdown
Member

Yup you're right. Still it should be possible to give the user an informative message, no?

I would hardcode this inside the generator code. This way it will be added automatically.

@VitalyVPinchuk did this already here:

internal fun writeMigratedRules(): String {
return """
style>ForbiddenPublicDataClass=Rule migrated to `libraries` ruleset plugin
style>LibraryCodeMustSpecifyReturnType=Rule migrated to `libraries` ruleset plugin
style>LibraryEntitiesShouldNotBePublic=Rule migrated to `libraries` ruleset plugin
""".trimIndent()

So it should be as easy as add a new line there.

@BraisGabin BraisGabin merged commit 7697efd into main Oct 23, 2022
@BraisGabin BraisGabin deleted the nc/TrailingComma branch October 23, 2022 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants