-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
--hintAsError:X
(analog to --warningAsError:X
)
#16763
Conversation
641324b
to
b73c53e
Compare
IMO this should be reverted until it has an RFC, |
A revert isn't justified IMO but I'm happy to discuss any further concern.
it's the exact same rationale as
the way you'd expect;
I wouldn't propose that, it wouldn't help with CI.
it's the exact same with |
It is not the same as warningAsError because warnings mean that there is something that could potentially cause issues further down the line, whereas hints are, well, hints and as such have nothing to do with errors. And if currently there is any hint that signifies potential danger, it should be converted to a warning IMO. In any case, I am fine with both reverting this PR or leaving it be, it is not a big issue i think. |
the boundary between warning and error is a gray area, some hints could be considered warnings and vice versa. If your definition of warning is In particular, there's not much severity difference between these 2 groups:
this would be a breaking change. So instead of converting some warnings to hints or vice versa (and debating forever which one is which), which would introduce a breaking change, I took the much more practical route of |
--hintAsError:X
--hintAsError:X
(analog to --warningAsError:X
)
No it would not. Getting a warning instead of a hint cannot break your code if that warning didn't exist before (because #14068 is not merged, for good reason).
It's not the same, warnings have a bad connotation, package authors are inclined to get rid of them even without --warningAsError. Hints on the other hand do not have a negative connotation so theres no reasonable reason to silence or get rid of them. |
I was referring to the suggestion
like I said, this distinction in severity can be arbitrary/historical in many cases, look at the 2 lists of hints/warnings I gave in #16763 (comment), I doubt there would ever be a consensus on which one should've been a hint vs a warning; |
There are pretty obvious differences between the warnings and hints you mentioned; if anything, I'd move However, the purpose of warnings and hints is different. To conflate them is an error, as is this PR. |
Converting hintX to warnX is not a breaking change, the corresponding
It avoids the question, but it makes the situation worse by conflating them even more, as the presence of a --hintAsError switch gives the impression that hints are something to be avoided. |
this would prevent valid use cases such as some codebase adding to their CI a check against unused imports.
With the same logic, No-one's forcing you to use hintAsError, warningAsError, styleCheck, etc; these are just tools you can use to maintain certain guarantees in your code, in particular in CI. |
I don't remember defending If you want to crash your CI, this is easy enough to do using |
That is the argument that I considered when I merged the PR and I still find it more convincing than the other arguments. However, I consider |
* --hintAsError * add test, changelog * condsyms
refs #15423 (comment)
this PR makes it easier to fix code so that hints such as
ConvFromXtoItselfNotNeeded
are not generated; this flag can be used in CI in future work (either nim's CI or in other package's CI)(There are other flags one may want to turn into an error in one's CI/cleanups beyond
ConvFromXtoItselfNotNeeded
, and other uses of hintAsError too)note
needed for followup PR #16764