-
-
Notifications
You must be signed in to change notification settings - Fork 769
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
Xml Report Merger now merges duplicate smells across input report files #5033
Conversation
} | ||
|
||
/** A list of checkstyle xml files written by Detekt */ | ||
private class DetektCheckstyleReports(private val files: Collection<File>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using classes here to help call out preconditons and assumptions about the input data. These functions started out as extension functions, but I didn't like the idea of applying something so specific to broad types such as Colleciton<File>
and List<Node>
Thoughs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have strong opinions, so I would just conform to the pattern in this file (Wrapping inside a class seems to be the pattern)
Codecov Report
@@ Coverage Diff @@
## main #5033 +/- ##
===========================================
+ Coverage 0 84.86% +84.86%
- Complexity 0 3555 +3555
===========================================
Files 0 500 +500
Lines 0 11753 +11753
Branches 0 2189 +2189
===========================================
+ Hits 0 9974 +9974
- Misses 0 692 +692
- Partials 0 1087 +1087
Continue to review full report at Codecov.
|
Build failure is Comparing the differences between the expected/actual reports, the difference I found was on the last line of the MD report: generated with [detekt version 1.21.0-RC2](https://detekt.dev/) on 2022-07-03 15:04:34 UTC vs generated with [detekt version 1.21.0-RC2](https://detekt.dev/) on 2022-07-03 15:04:35 UTC The difference is time? Is this a known flake? |
Pushed a commit mocking the time for more consistent MarkdownReportSpec results |
detekt-report-md/src/test/kotlin/io/github/detekt/report/md/MdOutputReportSpec.kt
Fixed
Show fixed
Hide fixed
53d0a92
to
ce2cf3d
Compare
Thanks for spotting this. Nope it was not known, but as the Markdown report was introduced recently, this was most likely the root cause. |
* <file> | ||
* <error> | ||
* </file> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:+100: on this documentation
detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/report/XmlReportMerger.kt
Outdated
Show resolved
Hide resolved
} | ||
|
||
/** A list of checkstyle xml files written by Detekt */ | ||
private class DetektCheckstyleReports(private val files: Collection<File>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have strong opinions, so I would just conform to the pattern in this file (Wrapping inside a class seems to be the pattern)
…kt/report/XmlReportMerger.kt
Xml Report Merger can now merge duplicate smells across multiple input report files. This is useful especially in Android, where running Detekt on multiple flavors identities many of the same errors on different flavors. Also cuts down on the amount of noise when these reports are submitted to Sonar.
I tried to make this as readable as possible, even though this process is complicated. Let me know if there is anything to improve on.