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

Add the -Wall option that enables all warnings #20545

Closed
wants to merge 2 commits into from

Conversation

Linyxus
Copy link
Contributor

@Linyxus Linyxus commented Jun 10, 2024

fixes #18559

This PR adds the -Wall option, which enables all warnings when it is set. Note that when -Wunused is not set (empty), setting -Wall is equivalent to passing -Wunused:all. But when -Wunused is set to some specific value (e.g. -Wunused:imports,locals), passing -Wall does not change it.

val WimplausiblePatterns = BooleanSetting(WarningSetting, "Wimplausible-patterns", "Warn if comparison with a pattern value looks like it might always fail.")
val WunstableInlineAccessors = BooleanSetting(WarningSetting, "WunstableInlineAccessors", "Warn an inline methods has references to non-stable binary APIs.")
val Wall: Setting[Boolean] = BooleanSetting(WarningSetting, "Wall", "Enable all warnings.")
private val overrideWithWall: (Setting[Boolean], (Boolean, Any) => Boolean) =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel overrideWithWall and all the warning settings are over-engineered. I think a better solution is to create an object which reads all warning settings properly and stores in ctx.

Copy link
Contributor Author

@Linyxus Linyxus Jun 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the suggestion! I'd appreciate some clarification: does the proposed solution mean that we create another object that takes Wall into consideration when reading all warning settings and store that object in the context (that object could be similar to WunusedHas)? Then at all use sites of these warning settings we read from that object instead?

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

Successfully merging this pull request may close these issues.

Add a flag that enables all linting
2 participants