Skip to content

Raise on invalid file path#827

Merged
Sija merged 3 commits into
masterfrom
fix/invalid-path
May 17, 2026
Merged

Raise on invalid file path#827
Sija merged 3 commits into
masterfrom
fix/invalid-path

Conversation

@Sija
Copy link
Copy Markdown
Member

@Sija Sija commented May 16, 2026

Resolves #787
Closes #388

Adds --ignore-unmatched-paths CLI flag to opt out of the new behaviour.

Original description

The intent of this PR is to raise if any of the provided inputs resolve to no files.

Before (silent success — misleading):

# Typo in filename — ameba says "all good!" but checked nothing
$ ameba typo.cr # => exits 0, no errors reported

# Non-existent directory — same problem
$ ameba "src/nonexistent/**/*.cr" # => exits 0, no errors reported

After (clear error):

$ ameba typo.cr
# => raises: "No files found matching `typo.cr`"

$ ameba "src/nonexistent/**/*.cr"
# => raises: "No files found matching `src/nonexistent/**/*.cr`"

@Sija Sija added this to the 1.7.0 milestone May 16, 2026
@Sija Sija requested a review from veelenga May 16, 2026 20:56
@Sija Sija self-assigned this May 16, 2026
@Sija Sija requested a review from nobodywasishere May 16, 2026 20:58
@straight-shoota
Copy link
Copy Markdown
Contributor

straight-shoota commented May 16, 2026

FWIW: When running the command ameba src/nonexistent/**/*.cr in a shell, the shell typically already expands the glob pattern and errors if it doesn't match.

This patch only has an effect when ameba resolves the glob pattern instead of the shell.
The command ameba 'src/nonexistent/**/*.cr' would be better for the change description. The quoting makes sure ameba receives the original pattern instead of its expansion.

Copy link
Copy Markdown
Member

@veelenga veelenga left a comment

Choose a reason for hiding this comment

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

lgtm 👍🏻

@Sija Sija force-pushed the fix/invalid-path branch from 1925884 to 0e4b8c2 Compare May 17, 2026 15:38
@Sija Sija merged commit fb3e728 into master May 17, 2026
13 checks passed
@Sija Sija deleted the fix/invalid-path branch May 17, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Providing an invalid file path should raise instead of silently ignoring it

3 participants