Skip to content

Show a helpful message when all CLI paths are excluded#93

Open
autarch wants to merge 1 commit intomasterfrom
fix/issue-92-excluded-paths-message
Open

Show a helpful message when all CLI paths are excluded#93
autarch wants to merge 1 commit intomasterfrom
fix/issue-92-excluded-paths-message

Conversation

@autarch
Copy link
Copy Markdown
Member

@autarch autarch commented May 3, 2026

Summary

Fixes #92.

When every path passed on the command line is matched by an exclude rule, precious previously returned a hard error (Found some paths when looking for ... but they were all excluded). This was unhelpful — the user had no indication it was safe to ignore.

This PR changes the behavior: precious now exits 0 and prints:

○ All paths given on the command line were excluded

This is distinct from the existing "No files found" message used when git modes return zero files, so the user knows specifically why nothing ran.

Implementation

  • In precious-core/src/precious.rs, the FinderError::AllPathsWereExcluded error is now caught explicitly in run_all_commands and converted to a clean exit with the new message, rather than propagating as an error.
  • FinderError::AllPathsWereExcluded is retained in finder.rs — it remains the right signal from the finder layer.

Tests

  • Unit test (precious-core/src/paths/finder.rs): cli_mode_given_dir_all_excluded — verifies the finder still returns AllPathsWereExcluded when all CLI paths are excluded.
  • Integration test (precious-integration/src/lint_tidy.rs): cli_paths_all_excluded — runs the binary with a fully-excluded path and asserts exit 0 and the expected message in stdout.

@autarch autarch force-pushed the fix/issue-92-excluded-paths-message branch from d5d1ebf to 951cded Compare May 3, 2026 20:37
When every path passed on the command line matches an exclude rule,
precious now exits cleanly with the message "All paths given on the
command line were excluded" rather than returning an error. Fixes #92.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@autarch autarch force-pushed the fix/issue-92-excluded-paths-message branch from 951cded to 79d8d8f Compare May 3, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

When asked to lint or tidy an ignored directory, the error it outputs is not helpful

1 participant