-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Fix -Wconf
and -nowarn
to be more consistent
#10750
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
Fix -Wconf
and -nowarn
to be more consistent
#10750
Conversation
801b298
to
820ad16
Compare
Somewhere in the Reporting adjusts the deprecation conf depending on deprecation.isSetByUser. Note: revisit |
ce202a3
to
7da120c
Compare
@som-snytt if I'm a Scala user hurriedly/impatiently reading the 2.13.15 release notes, what is the upshot of this change for me...? |
This comment was marked as resolved.
This comment was marked as resolved.
7da120c
to
2e0c786
Compare
In the current form it's both (which is the right thing), not "instead". |
@lrytz thanks again for the care you take. I reviewed the changes again and updated the text. |
if (needsDefaultAdjustment || settings.nowarn.value) { | ||
val (user, defaults) = conf.filters.splitAt(conf.filters.length - settings.WconfDefault.length) | ||
val Deprecation = MessageFilter.Category(WarningCategory.Deprecation) | ||
val action = if (settings.deprecation.value) Action.Warning else Action.Silent |
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.
Worth following up whether -deprecation -nowarn
does the obvious thing (whatever that is). With a custom reporter, there could be a difference between "what is displayed" and "warnings that reach the reporter"?
-Wconf
and -nowarn
to be more consistent
Always respect user
-Wconf
settings, including-nowarn
. Previously, some defaults were incorrectly enforced.For example,
-Wconf:cat=deprecation:e -deprecation -nowarn
would fail to issue an error on deprecation, but now correctly works the same as
-deprecation -nowarn -Wconf:cat=deprecation:e
-nowarn
sets-Xmaxwarns:0
(which limits how many warnings are displayed) and also suppresses the "summary" messages that report a summary count, as well as suppressing the error under-Werror
("No warnings can be incurred"). It addsany:s
to suppress any other warnings, and turns offcat=scala3-migration:e
that boosts migration errors under-Xsource:3
.Fixes scala/bug#12984
Fixes scala/bug#12664
Instead of adding wconf for deprecation when setting is selected, adjust the default filter when processing the configuration. This ensures that user config is respected in this respect.
Otherwise, subtle order dependency is not friendly.
Besides setting
maxwarns
,nowarn
is a trailing-Wconf:any:s
. That is, any unconfigured warnings are silenced. Configured warnings are counted and reported in the usual way, but summaries are silenced under-nowarn
.