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

Mark MultiRule as deprecated #5161

Merged
merged 5 commits into from Aug 7, 2022
Merged

Conversation

marschwar
Copy link
Contributor

This is the first step in removing MultiRule. It closes #4240.

I will create a checklist (or separate issues) for all remaining steps.

Note: I changed the usages to fully qualified as the build was failing with deprecation warnings in the imports and I did not want to suppress deprecation warnings for the entire file.

fun isCorrectable(rule: BaseRule): Boolean = when (rule) {
is Rule -> rule.autoCorrect
is MultiRule -> rule.rules.any { it.autoCorrect }
is io.gitlab.arturbosch.detekt.api.MultiRule -> rule.rules.any { it.autoCorrect }
Copy link
Member

Choose a reason for hiding this comment

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

Is this intended that we want to use the full qualified name for MultiRule?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there any other way (besides suppressing deprecation warning for the entire file) to avoid the build to fail because of a deprecated import?

Copy link
Member

Choose a reason for hiding this comment

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

There is not as far as I know. It would be really good to know if there is any other way.

@cortinico cortinico added the notable changes Marker for notable changes in the changelog label Aug 1, 2022
@cortinico cortinico added this to the 1.22.0 milestone Aug 1, 2022
@cortinico
Copy link
Member

You have a couple of references inside RuleProviderSpec which should also be annotated

@codecov
Copy link

codecov bot commented Aug 2, 2022

Codecov Report

Merging #5161 (fc16cb4) into main (cdd2d71) will increase coverage by 84.95%.
The diff coverage is 75.00%.

❗ Current head fc16cb4 differs from pull request most recent head d07f4d5. Consider uploading reports for the commit d07f4d5 to get more accurate results

@@             Coverage Diff             @@
##             main    #5161       +/-   ##
===========================================
+ Coverage        0   84.95%   +84.95%     
- Complexity      0     3638     +3638     
===========================================
  Files           0      502      +502     
  Lines           0    11992    +11992     
  Branches        0     2260     +2260     
===========================================
+ Hits            0    10188    +10188     
- Misses          0      691      +691     
- Partials        0     1113     +1113     
Impacted Files Coverage Δ
...otlin/io/gitlab/arturbosch/detekt/api/MultiRule.kt 100.00% <ø> (ø)
...otlin/io/gitlab/arturbosch/detekt/core/Analyzer.kt 82.02% <0.00%> (ø)
.../detekt/generator/collection/MultiRuleCollector.kt 75.00% <ø> (ø)
...n/io/github/detekt/report/sarif/RuleDescriptors.kt 30.43% <0.00%> (ø)
...io/gitlab/arturbosch/detekt/core/rules/RuleSets.kt 100.00% <100.00%> (ø)
...b/arturbosch/detekt/core/suppressors/Suppressor.kt 71.42% <100.00%> (ø)
...ab/arturbosch/detekt/formatting/KtLintMultiRule.kt 96.47% <100.00%> (ø)
...arturbosch/detekt/rules/documentation/KDocStyle.kt 100.00% <100.00%> (ø)
...itlab/arturbosch/detekt/rules/empty/EmptyBlocks.kt 100.00% <100.00%> (ø)
...tlab/arturbosch/detekt/rules/naming/NamingRules.kt 88.31% <100.00%> (ø)
... and 503 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@BraisGabin BraisGabin merged commit 0d42e58 into detekt:main Aug 7, 2022
@marschwar marschwar deleted the deprecate-multi-rule branch August 7, 2022 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api core formatting notable changes Marker for notable changes in the changelog rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should we deprecate MultiRule?
4 participants