feat(diagnose): add --no-color flag for CI/scripting - #58
Conversation
formatText and formatComparisonText prefix the report with a 📊 header and each result with an emoji status glyph, which breaks CI logs, log files, and pipes that expect plain text. Add a --no-color flag (default false) that swaps the emoji for bracketed markers ([PASS]/[FAIL]/[ERROR]) and drops the header glyph, so the text report is safe to grep and store. JSON, HTML, and Markdown output are unchanged. Closes francomano#42
francomano
left a comment
There was a problem hiding this comment.
Richiesta di modifica: --no-color promette di disabilitare le emoji per CI/log/pipeline, ma viene applicato soltanto al report formattato. Rimangono emoji nel banner, nelle righe "Running diagnosis"/"Via proxy", nei messaggi di errore e nel messaggio di salvataggio. Centralizza i marker/heading o rendi condizionali anche questi percorsi, quindi aggiungi un test end-to-end del comando che verifichi l’assenza di emoji nell’intero stdout.
francomano
left a comment
There was a problem hiding this comment.
English version of my change request: --no-color promises to disable emoji for CI, logs, and pipelines, but it currently only affects the formatted report. Emoji remain in the banner, the "Running diagnosis" / "Via proxy" lines, error messages, and the save confirmation. Please centralize these markers/headings or make those paths conditional as well, then add an end-to-end command test confirming that the complete stdout contains no emoji.
Closes #42
Summary
formatTextandformatComparisonTextprefix the report with a 📊 header and each result with an emoji status glyph (✅/❌/Add a
--no-colorflag (defaultfalse) that, when set, swaps the status emoji for plain bracketed markers and drops the header glyph, so the text report is safe to grep, store, and pipe.Changes
cmd/cli/commands/diagnose.go--no-colorbool flag registered ondiagnoseCmd(default false).statusMarker(result)helper: returns[PASS]/[FAIL]/[ERROR]when--no-coloris set, otherwise the existing emoji.textHeader(label)helper: returns the bare label when--no-coloris set, otherwise📊 <label>.formatTextandformatComparisonTextuse the helpers.cmd/cli/commands/diagnose_test.goTestFormatTextOmitsEmojiWhenNoColor: withnoColor=true, asserts no 📊/✅/❌/[PASS]/[FAIL]and the header label appear, and thatformatMarkdownis unaffected (still uses emoji).Acceptance criteria (#42)
--no-colorflag exists and defaults to falseVerification