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

Allow setting the level of every hint and warning #20905

Open
arnetheduck opened this issue Nov 24, 2022 · 4 comments
Open

Allow setting the level of every hint and warning #20905

arnetheduck opened this issue Nov 24, 2022 · 4 comments

Comments

@arnetheduck
Copy link
Contributor

Summary

For every warning and hint, allow setting the level to None, Hint, Warning or Error - basically, for every "optional" diagnostic, it should be possible to set its effect on the compilation process.

Description

The objective is that codebases that have addressed all instances of a particular kind can set that particular message to Error and prevent new instances from creeping into the codebase - the difference between Hint and Warning in the compiler is somewhat subjective as well - some hints are appropriate as warnings/errors in some codebases while some warnings are not urgent in some contexts.

Alternatives

No response

Standard Output Examples

No response

Backwards Compatibility

No response

Links

No response

@Araq
Copy link
Member

Araq commented Nov 24, 2022

We already have --warningAsError:warningX:on, are you aware? :-)

@arnetheduck
Copy link
Contributor Author

somewhat - but the way we interface with these is somewhat all over the place, specially when interacting with hints and style checks - ie the distinction between hint and warning is somewhat arbitrary, except for the "alert level" - --styleCheck:error for example sets the level of stylecheck "warnings" - the idea with this feature would be that there would be a single "notifications" mechanism, and for each message type in it, you could set the desired "level" - whatever flags set it would look like --msg:MessageX:error --msg:[MessageY,MessageZ]:none - then flags like styleCheck would have only on/off/usages - ie not serve the dual purpose as they do today.

Also, --warningsAsError doesn't allow me to turn warnings into hints or off - for that I have to use a different flag making the UX confusing (specially when taking into account features that were developed separately, like style checks).

@metagn
Copy link
Collaborator

metagn commented Nov 24, 2022

What exactly is the classifying difference between warnings and hints? Is it that one is off by default while the other is on?

@Araq
Copy link
Member

Araq commented Nov 24, 2022

No, there is not much difference. A "hint" is benign, a "warning" deserves your attention.

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

No branches or pull requests

3 participants