Skip to content
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

Warning if a file glob doesn't match anything #8634

Closed
michaelpj opened this issue Dec 13, 2022 · 1 comment · Fixed by #8640
Closed

Warning if a file glob doesn't match anything #8634

michaelpj opened this issue Dec 13, 2022 · 1 comment · Fixed by #8640
Labels
cabal-install: cmd/check good first issue re: globbing Concerning issues with globbing file patterns re: user experience User experience (UX) issue re: warnings Concerning warnings printed by cabal type: enhancement

Comments

@michaelpj
Copy link
Collaborator

As a user, if I've got a file glob that doesn't match anything, that almost certainly means I've made a mistake.

@ffaf1
Copy link
Collaborator

ffaf1 commented Dec 13, 2022

Mhhh this should already be there in cabal check:

Right parsedGlob -> do
results <- runDirFileGlob verbosity (root </> dir) parsedGlob
let individualWarnings = results >>= getWarning field glob
noMatchesWarning =
[ PackageDistSuspiciousWarn (GlobNoMatch field glob)
| all (not . suppressesNoMatchesWarning) results
]
return (noMatchesWarning ++ individualWarnings)

This is the test (added five years ago), added in #5403.

I am currently in the middle of a thorny rebase, an MRE would be quite welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cabal-install: cmd/check good first issue re: globbing Concerning issues with globbing file patterns re: user experience User experience (UX) issue re: warnings Concerning warnings printed by cabal type: enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants