Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@arturbosch
Copy link
Member

No description provided.

val runLastOnRoot = mutableListOf<FormattingRule>()
val runLast = mutableListOf<FormattingRule>()
for (rule in activeRules.filterIsInstance<FormattingRule>()) {
when (rule.wrapping) {

Choose a reason for hiding this comment

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

  • ⚠️ Type checking is a sign of violating the Open-Closed Principle. Consider introducing an abstraction (interface) for RestrictToRootLast, RestrictToRoot, Last, with new implementations of the interface for every class.

Copy link
Member Author

Choose a reason for hiding this comment

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

Difficult as it is not our code.

@github-actions
Copy link

Warnings
⚠️

detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/KtLintMultiRule.kt#L46 - KtLintMultiRule have a too high LCOM value: 1.0

⚠️

detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/KtLintMultiRule.kt#L46 - The class KtLintMultiRule is using inheritance, consider using composition instead. Does KtLintMultiRule want to expose the complete interface (runIfActive, postVisit, preVisit, visitCondition) of MultiRule such that KtLintMultiRule can be used where MultiRule is expected? Indicates inheritance. Does KtLintMultiRule want only some/part of the behavior exposed by MultiRule? Indicates Composition.

⚠️

detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/Indentation.kt#L11 - The class Indentation is using inheritance, consider using composition instead. Does Indentation want to expose the complete interface (apply, editorConfigUpdater, visit) of FormattingRule such that Indentation can be used where FormattingRule is expected? Indicates inheritance. Does Indentation want only some/part of the behavior exposed by FormattingRule? Indicates Composition.

Generated by 🚫 Danger Kotlin against aba2e3c

@arturbosch arturbosch added this to the 1.10.0 milestone May 18, 2020
@arturbosch arturbosch added the migration Marker to add a migration step in the changelog label May 18, 2020
@codecov
Copy link

codecov bot commented May 18, 2020

Codecov Report

Merging #2709 into master will increase coverage by 0.04%.
The diff coverage is 82.35%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2709      +/-   ##
============================================
+ Coverage     80.45%   80.50%   +0.04%     
- Complexity     2309     2310       +1     
============================================
  Files           377      377              
  Lines          6888     6899      +11     
  Branches       1245     1245              
============================================
+ Hits           5542     5554      +12     
+ Misses          727      724       -3     
- Partials        619      621       +2     
Impacted Files Coverage Δ Complexity Δ
...turbosch/detekt/formatting/wrappers/Indentation.kt 100.00% <ø> (ø) 4.00 <0.00> (ø)
...ab/arturbosch/detekt/formatting/KtLintMultiRule.kt 91.66% <82.35%> (+3.91%) 7.00 <2.00> (+1.00)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 57e0b91...aba2e3c. Read the comment docs.

@BraisGabin
Copy link
Member

D'ouch! Didn't saw this PR. I reviewed it in #2710.

@arturbosch
Copy link
Member Author

arturbosch commented May 18, 2020

Well, I'm not sure anymore if we should change the default Indentation rule ...
Both standard and experimental Indentation exist and can be loaded both. Idk what happens, if both run, or just one. There are also bug reports for the experimental rule.

They haven't promoted any experimental rules yet and the last release is from 12.2019.

@arturbosch arturbosch merged commit eb6291b into master May 19, 2020
@arturbosch arturbosch deleted the formatting-fixes branch May 19, 2020 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

migration Marker to add a migration step in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants