Documentation
¶
Overview ¶
Package report owns the output-layer renderers and the redacting slog handler. Field-name redaction is pinned to this layer per S04 §"Field-name redaction at the output layer" (S04:2321).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRedactingHandler ¶
NewRedactingHandler returns a slog.Handler that wraps the standard JSON handler with field-name redaction over the canonical five-pattern set: password, token, secret, api[_-]?key, authorization (case-insensitive). Any attribute whose name matches has its value replaced with the literal sentinel "[REDACTED]" before reaching the underlying writer.
The handler does NOT derive run_id or format attributes — that belongs to pkg/conformance.Run / RunModule per S04 §"Run-ID resolution" (S04:906) and §"Logger handling" (S04:1023). This handler emits whatever attrs the run-scoped child logger carries.
w is the destination writer. Production callers (internal/cli/logger.go in MR 3.5) pass os.Stderr; tests pass an in-memory writer to inspect the emitted bytes.
func WriteJUnit ¶
func WriteJUnit(r *conformance.Report, path string) error
WriteJUnit serializes r as a JUnit XML report to the file at path per S04 §"--report <path>: JUnit XML" (S04:1643-1725). It is the production file-writer entry point; the cmd/conformance --report wire-up that calls it lands in Step 24.
The parent directory's existence and writability are validated at the flag boundary by internal/cli's validateReport (S04 §Validation rules), so this path is a CLI-supplied value that has already passed that gate; WriteJUnit creates (or truncates) the file and writes the rendered XML. A create or write failure is wrapped with the report: prefix so the caller can surface the output-channel write-failure path (E-1).
func WriteStdout ¶
func WriteStdout(r *conformance.Report) error
WriteStdout renders r as the human-readable conformance report to os.Stdout per S04 §"stdout: human-readable conformance report" (S04:1534-1600): one status line per test in execution order, a detail block under each non-passing test, and a trailing Summary block. ANSI color is applied to the 4-char status prefix only, and only when os.Stdout is a TTY and NO_COLOR is unset (AC #63).
The TTY-and-NO_COLOR decision is delegated to fatih/color, the library S04:1601-1602 names as the owner of this detection: its package-level color.NoColor is computed at init from the live os.Stdout file descriptor and the NO_COLOR environment variable. Delegating keeps the color gate out of application code, as docs/dev/cli-style.md requires (no os.Getenv outside the credential carve-out) and docs/dev/go-libraries.md prescribes (no manual os.Getenv or isatty gating at call sites).
Types ¶
This section is empty.