Skip to content

--dir option to only run in subdirectory of module-root#1184

Open
aseembits93 wants to merge 4 commits intomainfrom
dir-option
Open

--dir option to only run in subdirectory of module-root#1184
aseembits93 wants to merge 4 commits intomainfrom
dir-option

Conversation

@aseembits93
Copy link
Contributor

No description provided.

@aseembits93 aseembits93 marked this pull request as draft January 30, 2026 23:50
@aseembits93 aseembits93 marked this pull request as ready for review February 23, 2026 15:50
@claude
Copy link
Contributor

claude bot commented Feb 23, 2026

PR Review Summary

Lint & Type Checks

  • mypy: ✅ No issues found in codeflash/cli_cmds/cli.py
  • ruff/prek: Tool not available in CI environment; no issues detected by mypy

Code Review

The PR adds a --dir option to restrict optimization to a subdirectory of module-root. The implementation converts --dir into args.all internally, reusing the existing discovery logic. Overall approach is sound.

No critical bugs or security issues found.

Minor observations (non-blocking):

  • The dir_arg variable on line 294 is redundant after args.all is already set on line 292 when --dir is used — hasattr(args, "all") already covers the dir_arg checks in conditions on lines 295 and 319
  • The elif chain at lines 321-325 will re-resolve an already-resolved Path when --dir is used (harmless but unnecessary)
  • No tests exist for the new --dir flag — all new code paths (lines 70-75, 166-172, 281-292) are uncovered

Test Coverage

File Stmts Miss Cover Notes
codeflash/cli_cmds/cli.py 180 127 29% New --dir code paths uncovered
  • New lines added: ~35 lines of new logic for --dir handling
  • Coverage of new code: 0% — the --dir argument definition (lines 70-75), validation (lines 166-172), and path resolution (lines 281-292) are all uncovered
  • Pre-existing coverage: The file had low coverage before this PR (CLI entry points are not unit-tested)
  • ⚠️ No tests exist for the --dir flag. Consider adding tests for:
    • Basic --dir with a valid subdirectory
    • --dir with path outside module-root (validation error)
    • --dir combined with --all / --file / --replay-test (conflict errors)
    • --dir with non-existent path

Codeflash Optimization PRs

No open optimization PRs targeting main.


Last updated: 2026-02-23

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