Closed calda closed 3 months ago
Attention: Patch coverage is 96.87500%
with 2 lines
in your changes are missing coverage. Please review.
Project coverage is 95.17%. Comparing base (
9ce956c
) to head (ede2953
).
Files | Patch % | Lines |
---|---|---|
Sources/Rules.swift | 95.45% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
The case for this is much less strong, e.g. if the type is something long like UnsafeMutablePointer<VeryLongName>
or whatever then you'll now be repeating it multiple times.
I think at the very least it warrants another configuration option, but I wonder if there's maybe a sensible heuristic, like to only apply it for simple class names, or ones below a certain character count?
Good thinking @nicklockwood, you're right. I added an option for this that is disabled by default.
The PR extends the
preferInferredTypes
rule to support if/switch expressions.Previously this example was left as-is:
Now it's converted to: