-
Notifications
You must be signed in to change notification settings - Fork 697
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
cabal check
: add --ignore
option
#9442
Conversation
67d7317
to
e7f7ea3
Compare
I think there should be an explicit conversion function from the Ideally all the check reasons would also be documented referring to these flag strings as well (and also ideally error codes for HF error index). In the end I think it would be better to display something like..
or
I also think that passing an unknown option should just be a warning, rather than an error, so it's easier to use with different versions of cabal which might support different check flags. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my other comments
bb7b793
to
ab342b7
Compare
Ok, now:
|
ab342b7
to
8ec9dc8
Compare
I will look again tomorrow. |
8ec9dc8
to
1d8b4a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
The only question I have is the value of having CheckExplanationId
as a datatype rather than type CheckExplanationId = String/ByteString/Text
. It seems that it is only converted to a string, and parsed from a string, are there any other manipulations of it that I am missing?
tl;dr: we need it to output a warning on unrecognised ignore strings. To output a warning when an unrecognized ignore string is passed to cabal check — say a spelling error like With If Does this make sense? |
1d8b4a5
to
10993b2
Compare
@mpickering does the explanation satisfy you? I am happy to answer questions or rework the code if needed. |
4bfc566
to
548e01b
Compare
@mpickering I will ping again. If there is anything I can do to help this review, I will happily do so. |
5569146
to
caee5eb
Compare
@mpickering wasn't responsive recently. Maybe it's the holiday season... But given a very convincing explanation about the data type, I took the liberty to dismiss Matt's request for changes. We still need a second approval though... |
FWIW @mpickering just said a few hours ago in #ghc:matrix.org that he's been very sick recently and not doing any work. |
Thanks Artem and get well soon Matthew. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, thank you! Nothing blocking from my perspective. So, it's up to you how to proceed.
2c32555
to
d2df7cc
Compare
* Introduce `-i/--ignore` command-line option. e.g. cabal check --ignore=missing-upper-bounds will not display “Missing upper bounds” warnings. * Additionally, a filterPackageChecksById function is now exported in Distribution.PackageDescription.Check.Warning; this can be used by third party tools. * Add CheckExplanationIDString to `cabal check` messages. e.g. from Error: The 'license' field is missing or is NONE. to Error: [license-none] The 'license' field is missing or is NONE. This makes using the cabal check `--ignore` option more immediate. * Spool `MissingField` into separate constructors. Introducing five new constructors for `CheckExplanation` MissingFieldCategory MissingFieldMaintainer MissingFieldSynopsis MissingFieldDescription MissingFieldSynOrDesc This provides better ergonomic for `cabal check --ignore` and makes it easier to update the manual if the need arises. * Add tests for desiderable `--ignore` string qualities (not too long, without too many '-', unique). * Warn when `--ignore` string is not recognised. Also add a test for this. * Add documentation. * Add changelog.
d2df7cc
to
08591a9
Compare
Add
--ignore
option tocabal check
, so you can ignore specific warnings. Closes #8587.Include the following checklist in your PR:
QA Notes
cabal init -nm
cabal check
cabal check --ignore=no-category