Classifier

class Classifier(profile: CompatibilityProfile = CompatibilityProfile())

Turns structural Changes into severity-ranked Findings by applying the rule matrix (design §7) under a CompatibilityProfile and the reader/writer SnapshotConfigs.

Compatibility is a function of (change, direction, reader/writer config), so the same change can be safe one way and breaking the other:

  • backward = new code reads old data -> the reader is the new config, the writer is the old config;

  • forward = old code reads new data -> the reader is the old config, the writer is the new config.

Only actionable findings are reported: a direction that is Severity.SAFE yields no finding. Config changes are themselves classified (design §6): a naming-strategy or discriminator change is a BREAK, a tightened reader a WARN.

Constructors

Link copied to clipboard
constructor(profile: CompatibilityProfile = CompatibilityProfile())

Functions

Link copied to clipboard
fun classify(changes: List<Change>, oldConfig: SnapshotConfig = SnapshotConfig(), newConfig: SnapshotConfig = SnapshotConfig()): List<Finding>

Classifies changes given the oldConfig (baseline) and newConfig (current) wire configurations.