Skip to content

Conversation

@nandhinisubbu
Copy link
Contributor

Enhancement - #6161

@SwiftLintBot
Copy link

SwiftLintBot commented Oct 25, 2025

18 Messages
📖 Building this branch resulted in the same binary size as when built on main.
📖 Linting Aerial with this PR took 0.79 s vs 0.79 s on main (0% slower).
📖 Linting Alamofire with this PR took 1.05 s vs 1.06 s on main (0% faster).
📖 Linting Brave with this PR took 6.91 s vs 6.89 s on main (0% slower).
📖 Linting DuckDuckGo with this PR took 21.94 s vs 22.04 s on main (0% faster).
📖 Linting Firefox with this PR took 10.89 s vs 10.87 s on main (0% slower).
📖 Linting Kickstarter with this PR took 7.63 s vs 7.62 s on main (0% slower).
📖 Linting Moya with this PR took 0.43 s vs 0.41 s on main (4% slower).
📖 Linting NetNewsWire with this PR took 2.4 s vs 2.41 s on main (0% faster).
📖 Linting Nimble with this PR took 0.63 s vs 0.61 s on main (3% slower).
📖 Linting PocketCasts with this PR took 6.77 s vs 6.75 s on main (0% slower).
📖 Linting Quick with this PR took 0.46 s vs 0.44 s on main (4% slower).
📖 Linting Realm with this PR took 3.34 s vs 3.33 s on main (0% slower).
📖 Linting Sourcery with this PR took 1.85 s vs 1.85 s on main (0% slower).
📖 Linting Swift with this PR took 4.2 s vs 4.2 s on main (0% slower).
📖 Linting VLC with this PR took 1.14 s vs 1.14 s on main (0% slower).
📖 Linting Wire with this PR took 17.4 s vs 17.41 s on main (0% faster).
📖 Linting WordPress with this PR took 11.48 s vs 11.54 s on main (0% faster).

Generated by 🚫 Danger

Copy link
Collaborator

@SimplyDanny SimplyDanny left a comment

Choose a reason for hiding this comment

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

Thanks @nandhinisubbu! Just one small improvement ...

static func generateReport(_ violations: [StyleViolation]) -> String {
let warningCount = violations.filter({ $0.severity == .warning }).count
let errorCount = violations.filter({ $0.severity == .error }).count
let testCount = violations.count
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
let testCount = violations.count
let testCount = warningCount + errorCount

So separate issues always add up to the total number.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@SimplyDanny, Does it mean, only the count of tests with severity as .warning and .error to be considered for tests count?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The JUnit reporter is a bit strange, because JUnit is actually a testing framework. We run tests in it and they either succeed or fail (or get skipped).

Now to support this format, we need to interpret SwiftLint results as kind of tests. But we only have tests that fail. So the total number of tests is comprised by the number of issues we report, and those are either warnings or errors.

That said, violations.count is totally fine as well. Adding warnings and errors makes clearer, though, that the reporter numbers are consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the clarification @SimplyDanny!, have pushed the changes.

@SimplyDanny SimplyDanny merged commit 4cca828 into realm:main Oct 25, 2025
23 checks passed
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