Package org.egothor.methodatlas.command
Class DiffCommand
java.lang.Object
org.egothor.methodatlas.command.DiffCommand
- All Implemented Interfaces:
Command
CLI command handler for the
-diff mode.
Compares two MethodAtlas scan CSV outputs and emits a delta report showing added, removed, and modified test methods.
When requireJustification is true, every security-relevant
method that was removed must have a matching entry in the overrideFile.
The command exits with code 1 when any unjustified removal is found.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDiffCommand(Path before, Path after) Creates a new diff command without the removal gate.DiffCommand(Path before, Path after, boolean requireJustification, Path overrideFile) Creates a new diff command with optional removal-gate enforcement. -
Method Summary
Modifier and TypeMethodDescriptionintexecute(PrintWriter out) Computes and emits the delta between the two scan CSV outputs, and optionally enforces the removal-justification gate.
-
Constructor Details
-
DiffCommand
Creates a new diff command without the removal gate.- Parameters:
before- path to the before scan CSVafter- path to the after scan CSV
-
DiffCommand
Creates a new diff command with optional removal-gate enforcement.- Parameters:
before- path to the before scan CSVafter- path to the after scan CSVrequireJustification- whentrue, exits non-zero if any security-relevant test was removed without a matching entry inoverrideFileoverrideFile- path to a MethodAtlas override YAML supplying removal justifications; ignored whenrequireJustificationisfalse;nullmeans no justifications are on file- Since:
- 3.0.0
-
-
Method Details
-
execute
Computes and emits the delta between the two scan CSV outputs, and optionally enforces the removal-justification gate.- Specified by:
executein interfaceCommand- Parameters:
out- writer that receives the delta report- Returns:
0on success;1when the removal gate fires- Throws:
IOException- if either CSV file cannot be read
-