Skip to content

fix: surface silent validation gaps in tickers, screen, search (#49)#53

Merged
joce merged 2 commits into
mainfrom
fix/49-silent-validation
May 25, 2026
Merged

fix: surface silent validation gaps in tickers, screen, search (#49)#53
joce merged 2 commits into
mainfrom
fix/49-silent-validation

Conversation

@joce
Copy link
Copy Markdown
Owner

@joce joce commented May 25, 2026

Summary

  • tickers: --exchange and --mf are now an argparse mutually-exclusive group; passing both errors immediately (exit 2) instead of silently ignoring --mf. Implemented via a new optional CommandSpec.mutually_exclusive field plumbed through register_subparsers.
  • screen: --exchange now validates against the known set (NYSE/Nasdaq/OTC/CBOE) and surfaces a meta.warnings entry for unknown values. Tolerant by design — the request still runs (so unknown values from possible future SEC additions don't break) — but typos like BOGUS are no longer invisible.
  • search: empty/whitespace query and --limit < 1 now fail loudly via EdgarqParamError + emit_error instead of silently returning [].

Test plan

  • pytest tests/commands_impl/test_tickers.py tests/commands_impl/test_screen.py tests/commands_impl/test_search.py tests/test_commands.py tests/test_cli_help.py tests/test_cli_smoke.py — 148 passed
  • Smoke: uv run edgarq tickers --exchange --mf --limit 1 → exit 2, "not allowed with argument --exchange"
  • Smoke: uv run edgarq search "" --limit 5 → exit 1, JSON error envelope on stdout
  • Smoke: uv run edgarq search test --limit 0 → exit 1, JSON error envelope on stdout
  • CI green across py3.10–3.14

Fixes #49

joce added 2 commits May 24, 2026 22:05
- tickers: --exchange and --mf are now an argparse mutually-exclusive
  group; passing both errors with SystemExit(2). Added an optional
  CommandSpec.mutually_exclusive field wiring through register_subparsers.
- screen: --exchange now compares against the known set
  (NYSE/Nasdaq/OTC/CBOE) and surfaces a meta.warnings entry for unknown
  values; behaviour stays tolerant (still returns rows) so typos aren't
  invisible but live data still flows.
- search: empty/whitespace query and --limit < 1 now fail loudly via
  EdgarqParamError + emit_error instead of silently returning [].

Fixes #49
@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@joce joce merged commit 00cd265 into main May 25, 2026
14 checks passed
@joce joce deleted the fix/49-silent-validation branch May 25, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Silent validation gaps: tickers --exchange+--mf, screen bogus exchange, search empty/limit-0

2 participants