Originally created by: fu351
Originally owned by: AshSgDe29071999
doberman scan --json --quiet prints the full JSON document — --quiet has no effect.
That's because the JSON branch returns before the quiet check ever runs (src/doberman/cli/main.py:226-245):
if as_json:
...
return # <- returns here
if not quiet:
... # <- never reached when --json is passed
Probably not — JSON-wins is the sensible precedence. If you asked for machine-readable output, suppressing it would leave you with nothing, and --quiet exists to suppress the human risk map.
The problem is that nothing records that decision:
tests/unit/test_cli_scan_json.py, tests/unit/test_cli_scan_quiet.py)docs/CLI.md says nothing about itSo today the behaviour is an accident of statement order. A future refactor could reverse it and every test would stay green.
["scan", "--json", "--quiet"] that asserts valid JSON is still printed and the exit code is unchanged. Put it in whichever of the two existing test files fits better.docs/CLI.md stating the precedence: --json wins over --quiet.A test fails if someone reorders those branches so --quiet suppresses JSON, and docs/CLI.md states the precedence.
Make sure the test can actually fail. Before opening the PR, temporarily move the if not quiet: check above the if as_json: branch and confirm your test goes red — then revert. A test that passes under both orderings isn't pinning anything.
That check matters here: two tests merged into this repo last week passed while asserting nothing at all, so "CI is green" isn't evidence on its own.
Comment here to claim it.
🤖 Generated with Claude Code
Originally posted by: AshSgDe29071999
I'd like to pin
scan --jsonvs--quietprecedence with a test and docs line.Ticket changed by: fu351