Skip to content

fix(cli): discovery and path filtering robustness (#352, #334, #335) - #358

Merged
jeremy-wayland merged 5 commits into
mainfrom
feat/cli-discovery-path-filtering
Sep 16, 2026
Merged

jeremy-wayland merged 5 commits into
mainfrom
feat/cli-discovery-path-filtering

Conversation

@jeremy-wayland

Copy link
Copy Markdown
Member

PR 1: CLI Discovery & Path Filtering Robustness

Resolves #352, resolves #334, resolves #335.

Summary of Changes:

  1. Graceful exit on 0 supported source files (Fatal exit code when evaluating directory with 0 supported source files (type-only / config packages) #352):

    • When evaluating directories containing zero supported source files (such as type-only packages or configuration-only packages), exits with status code 0 and emits an informational message (info: no supported source files found...), rather than a fatal error exit code 1.
    • --json output returns {"version": "...", "results": [], "warnings": []} with exit code 0.
    • Explicit named missing paths or unsupported file extensions still return fatal exit codes as expected.
  2. Scope ambiguous skip names to root only (Discovery silently skips source directories named coverage/, build/, out/, dist/, env/ #334):

    • Scoped ambiguous directory skip names (coverage, build, out, dist, env) to top-level/root traversal only.
    • Legitimate nested source modules like src/commands/coverage/ or src/build/ are now fully scanned.
    • Common non-source/virtualenv directory names (node_modules, .venv, target, __pycache__, etc.) and actual virtualenvs continue to be skipped unconditionally at any depth.
  3. Built-in ignore defaults and .toposignore (No default exclusions for fixtures and generated code; .toposignore is opt-in and unused here #335):

    • Added conservative built-in ignore defaults for minified files (*.min.*), test fixtures/vendor/testdata/snapshots directories (fixtures, vendor, testdata, __snapshots__), and files starting with @generated / Code generated by ... DO NOT EDIT header markers in their first lines.
    • Added repository root .toposignore excluding tests/fixtures/, benchmarks/, and scratch/.

Verification:

  • All unit, integration, and doc tests pass (cargo test).
  • Verified with cargo clippy --all-targets and cargo fmt --check.
  • Ran discovery test cases for nested modules, root skips, and generated header exclusions.

jeremy-wayland and others added 2 commits August 23, 2026 23:07
- Gracefully exit with status 0 and info notice when evaluating directories with 0 supported source files (fixing #352)
- Scope ambiguous skip names (coverage, build, out, dist, env) to top-level/root only so submodules like src/commands/coverage/ are scanned (fixing #334)
- Add built-in ignore defaults for minified files (*.min.*), fixtures/vendor/testdata/__snapshots__, and @generated header markers (fixing #335)
- Add repository root .toposignore covering fixtures, benchmarks, and scratch
Empty evaluate was exiting 0 before the pillar gate, so CI with --failures could pass with nothing measured.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jeremy-wayland
jeremy-wayland marked this pull request as ready for review September 4, 2026 13:29

@sgathrid sgathrid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved --> @jeremy-wayland see PR #362

@jeremy-wayland
jeremy-wayland merged commit 539b414 into main Sep 16, 2026
24 checks passed
This was referenced Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants