Closed ileitch closed 3 months ago
Being able to set the baseline in the config file can also be very useful, so that people can just run periphery scan
and not unexpectedly see lots of violations.
The SwiftLint implementation doesn't have this yet, but there is a PR open for it - https://github.com/realm/SwiftLint/pull/5552
So one nice thing about saving the serialized ScanResults is that it makes it very easy to implement the baseline command
Let's defer this to a future change. I think the fundemental function of using the USR for comparisson should remain the same, we'd just need to update the format to include some contextual information for each USR.
Being able to set the baseline in the config file can also be very useful, so that people can just run periphery scan and not unexpectedly see lots of violations.
Yep, this is supported with the baseline
and write_baseline
yaml keys.
So one nice thing about saving the serialized ScanResults is that it makes it very easy to implement the
baseline
command, which allows easy inspection, and comparison of baselines, using the existing reporting mechanisms for violations (Formatters
inperiphery
terminology, orReporters
in SwiftLint).I've included the help from SwiftLint's
baseline
command below. This is probably a minority interest, but it does let you answer questions like "what violations am I ignoring?", and "how many more violations have been introduced for disabled rules since time T".This doesn't effect the main baseline functionality during scans at all, and is definitely a nice to have. I'm not sure exactly what you'd need to save to be able to reproduce the reporting.