Skip to content

Refactor main parsing flow and add regression coverage#331

Merged
jwilder merged 3 commits into
masterfrom
repo-agent/repo-agent/high-complexity-main-complexity20
Jun 12, 2026
Merged

Refactor main parsing flow and add regression coverage#331
jwilder merged 3 commits into
masterfrom
repo-agent/repo-agent/high-complexity-main-complexity20

Conversation

@jwilder

@jwilder jwilder commented Jun 12, 2026

Copy link
Copy Markdown
Owner

What changed

  • Refactored main to move argument parsing and related setup into smaller helper functions, reducing branching and complexity in the entrypoint.
  • Added focused tests for:
    • delimiter parsing
    • wait URL parsing
    • HTTP header parsing
    • processing template file and directory arguments

Why

This fixes the high-complexity issue reported for main by separating parsing logic from the top-level flow. The change makes the code easier to follow and maintain, while adding regression coverage for parsing and template-processing behaviors that are now handled by dedicated helpers.

How to verify

  • Run the test suite:
    • go test ./...
  • Optionally review the new unit tests in main_test.go to confirm coverage for valid and invalid parsing cases.

@jwilder jwilder merged commit 84d14e5 into master Jun 12, 2026
12 checks passed
@jwilder jwilder deleted the repo-agent/repo-agent/high-complexity-main-complexity20 branch June 12, 2026 11:53
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.

1 participant