Skip to content

Conversation

@artemcm
Copy link
Contributor

@artemcm artemcm commented Oct 23, 2025

This brings this control in line with other diagnostic controls we have which operate on a per-group level. DefaultIgnoreWarnings diagnostic group option applies to all warnings belonging to a certain diagnostic group.

The inheritance rules are:

  • Marking a diagnostic group as DefaultIgnoreWarnings means warnings belonging to this group will not be emitted by-default
    • Warnings belonging to sub-groups of this group will also not be emitted by-default
  • Enabling a DefaultIgnoreWarnings group (with -Werror,-Wwarning, etc.) means warnings belonging to this group will be emitted.
    • Warnings belonging to sub-groups of this group will also be emitted.
    • Warnings belonging to super-groups of this group will not be affected.

@artemcm
Copy link
Contributor Author

artemcm commented Oct 23, 2025

@swift-ci test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

Love this, thank you!

@artemcm artemcm force-pushed the DefaultIgnoreDiagnosticGroups branch from 5395e8b to 83eea39 Compare October 23, 2025 23:30
@artemcm
Copy link
Contributor Author

artemcm commented Oct 23, 2025

@swift-ci smoke test

@artemcm artemcm enabled auto-merge October 23, 2025 23:30
@artemcm artemcm force-pushed the DefaultIgnoreDiagnosticGroups branch 3 times, most recently from 51c5d05 to 9e9d91b Compare October 27, 2025 17:09
@artemcm artemcm requested a review from jckarter as a code owner October 27, 2025 17:09
@artemcm
Copy link
Contributor Author

artemcm commented Oct 27, 2025

@swift-ci smoke test

@artemcm artemcm force-pushed the DefaultIgnoreDiagnosticGroups branch from 9e9d91b to 79e3542 Compare October 28, 2025 23:56
@artemcm
Copy link
Contributor Author

artemcm commented Oct 28, 2025

@swift-ci smoke test


/// The diagnostic warnings belonging to this group should be ignored by default,
/// but will be re-enabled by various warning options (-Wwarning, -Werror).
DefaultIgnoreWarnings,
Copy link
Contributor

Choose a reason for hiding this comment

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

out of curiosity, is functionality like this expected to remain 'one way'? i.e. you can go from ignored to not, but you can't go back.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's right; but, we're building towards a way to go in the other direction with source-level controls:
https://forums.swift.org/t/pitch-source-level-control-over-compiler-warnings/

@artemcm artemcm force-pushed the DefaultIgnoreDiagnosticGroups branch from 79e3542 to f2ac958 Compare October 29, 2025 16:15
@artemcm
Copy link
Contributor Author

artemcm commented Oct 29, 2025

@swift-ci smoke test

…esponding option on diagnostic groups

This brings this control in line with other diagnostic controls we have which operate on a per-group level.
'DefaultIgnoreWarnings' diagnostic group option applies to all warnings belonging to a certain diagnostic group.

The inheritance rules are:
- Marking a diagnostic group as 'DefaultIgnoreWarnings' means warnings belonging to this group will not be emitted by-default
  - Warnings belonging to sub-groups of this group will also not be emitted by-default
- Enabling a 'DefaultIgnoreWarnings' group (with '-Werror','-Wwarning', etc.) means warnings belonging to this group will be emitted.
  - Warnings belonging to sub-groups of this group will also be emitted.
  - Warnings belonging to super-groups of this group will not be affected.
@artemcm artemcm force-pushed the DefaultIgnoreDiagnosticGroups branch from f2ac958 to 9e35f82 Compare October 29, 2025 16:42
@artemcm
Copy link
Contributor Author

artemcm commented Oct 29, 2025

@swift-ci smoke test

@artemcm artemcm merged commit 1b38c91 into swiftlang:main Oct 29, 2025
3 checks passed
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.

4 participants