Split oversized modules and gate file length at 500 lines#38
Merged
Conversation
No source or test file is allowed to exceed 500 lines, so split the worst offenders and add a check that enforces the cap going forward: - Extract the streaming orchestration (SourceOptions, StreamSession, validate_sources) out of commands/stream.py into streaming/session.py; the command keeps the flag signature and source dispatch. - Split tests/test_stream_command.py into command, session, and llm suites, and tests/test_setup.py into install vs remove/unit suites, sharing fakes via tests/setup_helpers.py. - Add scripts/max_file_length.py and wire it into scripts/check.sh.
Typer renders option errors in a bordered Rich panel; at narrow terminal widths the message wraps and the box borders split "does not exist" across lines, so the plain substring check failed depending on terminal width. Flatten the panel (drop borders, collapse whitespace) before matching.
alexkroman
pushed a commit
that referenced
this pull request
Jun 8, 2026
PR #38 split the setup tests into test_setup.py and test_setup_install.py (sharing tests/setup_helpers.py). The `_force_json` autouse fixture this branch added — needed because output is now human-by-default — only lived in test_setup.py, so the install/status tests that moved to the new file parsed human text as JSON and failed (14 JSONDecodeError failures in CI). Add the same fixture to test_setup_install.py. https://claude.ai/code/session_01MyytEHLdk3mWdAY3p16cwX
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.
No source or test file is allowed to exceed 500 lines, so split the
worst offenders and add a check that enforces the cap going forward:
validate_sources) out of commands/stream.py into streaming/session.py;
the command keeps the flag signature and source dispatch.
suites, and tests/test_setup.py into install vs remove/unit suites,
sharing fakes via tests/setup_helpers.py.