Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@som-snytt
Copy link
Contributor

@som-snyttsom-snytt commentedApr 10, 2024
edited
Loading

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.

Fixesscala/bug#12984
Fixesscala/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 settingmaxwarns,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.

@scala-jenkinsscala-jenkins added this to the2.13.15 milestoneApr 10, 2024
@som-snyttsom-snyttforce-pushed theissue/12984-wconf-deprecation branch from801b298 to820ad16CompareApril 11, 2024 01:19
@som-snytt
Copy link
ContributorAuthor

som-snytt commentedApr 11, 2024
edited
Loading

Somewhere in the-Wconf PR, there was a "reset setByUser", a facility I needed for the test (WConfTest.default).

Reporting adjusts the deprecation conf depending on deprecation.isSetByUser.

Note: revisitreset impls

@som-snyttsom-snyttforce-pushed theissue/12984-wconf-deprecation branch 3 times, most recently fromce202a3 to7da120cCompareMay 9, 2024 18:54
@som-snyttsom-snytt requested a review fromlrytzJune 21, 2024 04:57
@SethTisue
Copy link
Member

@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...?

@som-snyttsom-snytt changed the titleAdjust deprecation config after WconfUser Wconf is respected by default behavior such as summary of deprecationsJul 18, 2024
@SethTisue

This comment was marked as resolved.

@som-snyttsom-snyttforce-pushed theissue/12984-wconf-deprecation branch from7da120c to2e0c786CompareAugust 8, 2024 01:00
@lrytz
Copy link
Member

lrytz commentedAug 14, 2024
edited
Loading

Instead of settingmaxwarn,nowarn is a trailing-Wconf:any:s.

In the current form it's both (which is the right thing), not "instead".

@som-snyttsom-snytt changed the titleUser Wconf is respected by default behavior such as summary of deprecations-Wconf and -nowarn are more consistentAug 14, 2024
@som-snytt
Copy link
ContributorAuthor

@lrytz thanks again for the care you take. I reviewed the changes again and updated the text.

@som-snyttsom-snytt merged commitd9a9637 intoscala:2.13.xAug 14, 2024
@som-snyttsom-snytt deleted the issue/12984-wconf-deprecation branchAugust 14, 2024 13:37
if (needsDefaultAdjustment|| settings.nowarn.value) {
val (user, defaults)= conf.filters.splitAt(conf.filters.length- settings.WconfDefault.length)
valDeprecation=MessageFilter.Category(WarningCategory.Deprecation)
valaction=if (settings.deprecation.value)Action.WarningelseAction.Silent
Copy link
ContributorAuthor

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"?

@SethTisueSethTisue added the release-notesworth highlighting in next release notes labelAug 14, 2024
@SethTisueSethTisue changed the title-Wconf and -nowarn are more consistentFix-Wconf and-nowarn to be more consistentAug 22, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@lrytzlrytzlrytz approved these changes

Assignees

No one assigned

Labels

release-notesworth highlighting in next release notes

Projects

None yet

Milestone

2.13.15

Development

Successfully merging this pull request may close these issues.

-Wconf can depend on order of other args, such as -deprecation Reporter counts warnings when-nowarn is enabled

4 participants

@som-snytt@SethTisue@lrytz@scala-jenkins

[8]ページ先頭

©2009-2025 Movatter.jp