fix: surface silent validation gaps in tickers, screen, search (#49)#53
Merged
Conversation
- 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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--exchangeand--mfare now an argparse mutually-exclusive group; passing both errors immediately (exit 2) instead of silently ignoring--mf. Implemented via a new optionalCommandSpec.mutually_exclusivefield plumbed throughregister_subparsers.--exchangenow validates against the known set (NYSE/Nasdaq/OTC/CBOE) and surfaces ameta.warningsentry for unknown values. Tolerant by design — the request still runs (so unknown values from possible future SEC additions don't break) — but typos likeBOGUSare no longer invisible.--limit < 1now fail loudly viaEdgarqParamError+emit_errorinstead 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 passeduv run edgarq tickers --exchange --mf --limit 1→ exit 2, "not allowed with argument --exchange"uv run edgarq search "" --limit 5→ exit 1, JSON error envelope on stdoutuv run edgarq search test --limit 0→ exit 1, JSON error envelope on stdoutFixes #49