Skip to content

cabal check: add command line option to disable some warnings #8587

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

Closed
ffaf1 opened this issue Nov 12, 2022 · 2 comments · Fixed by #9442
Closed

cabal check: add command line option to disable some warnings #8587

ffaf1 opened this issue Nov 12, 2022 · 2 comments · Fixed by #9442

Comments

@ffaf1
Copy link
Collaborator

ffaf1 commented Nov 12, 2022

With #8361 soon to be merged, cabal check will warn about missing upper bounds in all dependencies.
As suggested in the discussion, a way to disable this — or disable any specific warning, like hlint does — could be appreciated by some users.

@ffaf1
Copy link
Collaborator Author

ffaf1 commented Feb 17, 2023

Borrowing some ideas from hlint. The UI is simple enough:

  -o --only=HINT                           Specify which hints explicitly
  -i --ignore=HINT                         Ignore a particular hint

HINT is a string prepended to every suggestion:

Cabal/src/Distribution/PackageDescription/Check.hs:1806:8-59: Suggestion: Fuse concatMap/map
Found:
  concatMap checkBench (map snd $ condBenchmarks pkg)
Perhaps:
  concatMap (checkBench . snd) (condBenchmarks pkg)

so it is immediate for a user to pick it up and append -i "Fuse concatMap/map" to the command (compare with “having to scan hlint --help for the correct option”).

@ffaf1
Copy link
Collaborator Author

ffaf1 commented Feb 18, 2023

I have a rough, working implementation of this. #8427 needs to be merged first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant