Skip to content

Split oversized modules and gate file length at 500 lines#38

Merged
alexkroman merged 2 commits into
mainfrom
claude/split-long-files-9qfqv
Jun 8, 2026
Merged

Split oversized modules and gate file length at 500 lines#38
alexkroman merged 2 commits into
mainfrom
claude/split-long-files-9qfqv

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

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.

claude added 2 commits June 8, 2026 00:07
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 alexkroman merged commit 472b69f into main Jun 8, 2026
10 checks passed
@alexkroman alexkroman deleted the claude/split-long-files-9qfqv branch June 8, 2026 00:49
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
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.

2 participants