-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Providing an invalid file path should raise instead of silently ignoring it #388
Comments
Duplicate of #362 |
@Sija this looks like a separate issue. See the difference between config file path and a file to check. |
Yeah, I originally considered adding to the other issue, but thought maybe they'd be different enough where one is
and this is
I guess another option could be to combine them in to a single issue that's like "passing file paths that don't exist should raise an error in all cases"? |
You're right, I was trigger happy 😅 |
This is an interesting one to implement because the command line arguments can be a single file or a glob. In glob_utils.cr#expand the list of arguments are expanded and only file paths which exist are returned from This makes it hard to catch non-existent files anywhere else in the code base after the globs have been expanded, which is why I'm thinking to implement this in My idea is to raise an exception if a particular glob doesn't return any results from
I'll make a PR using this approach, but I'm open to feedback on different approaches. |
@stufro thanks for taking a look. This is what I would expect, however, need to understand if there are non-intuitive edge cases. |
Thanks - #394. I've tried all the edge cases I can think of and it work as I would expect. |
Sort of related: #362
But in this case, if you just tell ameba to check a file that doesn't exist, it returns Inspecting 0 files
I'm thinking of maybe a situation where someone has a CI and types the name of a path wrong, the CI runs and says things are all good, but you don't find out until later that's not the case.
The text was updated successfully, but these errors were encountered: