Skip to content

Conversation

@0marperez
Copy link
Contributor

@0marperez 0marperez commented Sep 19, 2025

Issue #, if available:
N/A

Description of changes:

  • Refactor out ruleSet from rule IDs
  • ktlint rule to make sure that @PlannedRemoval is always accompanied by @Deprecated

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@@ -43,7 +43,7 @@ class DeprecatedApiRule : Rule(RuleId("minor-version-strategy-rules:deprecated-a
emit(
node.startOffset,
"The deprecated API is scheduled for removal, please remove it before releasing the next minor version.",
true,
false,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is to indicate if the rule can be auto-corrected. It should've been false from the beginning.

@0marperez 0marperez marked this pull request as ready for review September 19, 2025 19:06
@0marperez 0marperez requested a review from a team as a code owner September 19, 2025 19:06
smithy-gradle-plugin-version = "1.3.0"
junit-version = "5.10.1"
coroutines-version = "1.10.2"
slf4j = "2.0.17"
Copy link
Member

Choose a reason for hiding this comment

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

naming: slf4j-version

import com.pinterest.ktlint.rule.engine.core.api.RuleSetId

class MinorVersionRuleSetProvider : RuleSetProviderV3(RuleSetId("minor-version-strategy-rules")) {
internal const val RULE_SET = "minor-version-strategy-rules"
Copy link
Member

Choose a reason for hiding this comment

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

Can you explain this RULE_SET refactor?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean the MinorVersionRuleSetProvider one or in general?

Copy link
Member

Choose a reason for hiding this comment

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

In general, why do we need it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Every rule ID needs to have a rule-set ID followed by : and then the name of the rule. This is just to stop repeating the rule-set ID so many times.

@0marperez 0marperez changed the title feat: deprecatedUntilVersion ktlint rule feat: plannedRemoval ktlint rule Sep 22, 2025
@0marperez 0marperez merged commit 7215cb0 into main Sep 22, 2025
7 checks passed
@0marperez 0marperez deleted the deprecated-until-version-rule branch September 22, 2025 17:12
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.

3 participants