baseline compare
produces some false alarms
#5606
Labels
bug
Unexpected and reproducible misbehavior.
baseline compare
produces some false alarms
#5606
New Issue Checklist
Describe the bug
The
baseline compare
subcommand is implemented as follows:This re-uses the Baseline
filter
API, passing in the underlyingStyleViolation
's, and ignoring the existingtext
values. Duringfilter
, the files referred to in theStyleViolation
will be read to determine thetext
for eachStyleViolation
. This is fine when linting, as the files will be present, but duringbaseline compare
, there is no guarantee that the source files will be there at all, or that they will be the same as the files that were present when the baseline was constructed.Where the files are not present, or have changed, the
text
values will not match, and violations for those files will be considered as "new" when comparing the baselines.The fix for this will be to not throw away the
text
information in the Baseline, and to use a lower-level API to compare the baselines.Complete output when running SwiftLint, including the stack trace and command used
Environment
swiftlint version
to be sure)?0.55.1
N/A
If so, paste their relative paths and respective contents. No
xcodebuild -version
)? Xcode 15.2The text was updated successfully, but these errors were encountered: