Repository navigation
Feat: added CLI Friendly output format and json - #29
Conversation
|
Thanks for this, reviewed the code. Two things to fix before merge:
Smaller nit: the |
|
@shossain786 on it |
|
@shossain786 i made some changes those are :- |
|
Both fixes look right — exit code 3 cleanly separates runtime errors from quality-gate failures now, and the schema/line:0 handling checks out. Ran the full suite locally too (55/55 green) plus a manual smoke test of --format json --fail-under. Thanks for the thorough follow-through on the review, merging this. |
What & why
Enables CI/CD pipelines and automated tooling to consume analysis reports and enforce minimum migration confidence thresholds:
--format <text|json>: Adds support for machine-readable JSON output (--format json) for tooling and dashboards, withtextremaining the default.--fail-under <percent>: Adds a threshold check (0–100) that exits with code1if the estimated migration confidence score is strictly below the threshold. The report (text or JSON) is always emitted prior to exiting so that build logs remain actionable.0: Success (analysis succeeded and confidence meets--fail-underif set).1: Threshold failure (confidence strictly below--fail-under).2: Invocation / CLI usage error (unknown options, missing arguments, invalid threshold, missing/non-existent directory).README.md.Type of change
MIG-xxx)Checklist
mvn testpassesNotes for reviewers
JsonRendererto keep the project lightweight and avoid adding Jackson / external libraries to the shaded JAR.unparsableFilesandfindings[].file) normalize backslashes to/so JSON outputs are deterministic across Windows and Linux.ReportJsonTest.java: Validates JSON structure, empty reports, finding details, escaping of quotes/newlines/control characters.CliTest.java: Covers in-memory execution and actual OS subprocess execution (ProcessBuilder) verifying exit codes0,1,2, argument order permutations, and edge-case validation.closes #9