Skip to content

Conversation

@d-ronnqvist
Copy link
Contributor

Bug/issue #, if applicable: rdar://107343046

Summary

This adds support for controlling the severity of specific diagnostics and "diagnostic groups" using --Werror and --Wwarning flags. Those flag spellings were chosen because it's the spellings that Swift added in SE-0443.

Note

This draft PR is incomplete but sufficient to start the necessary Forum discussion about the broader design and user facing behaviors (flag names etc.).

I'm also planning to:

  • Update the default diagnostic formatter to display the diagnostic group id (or diagnostic id as a fallback) within square braces, like Swift does.
  • Update the SwiftDocC documentation (aimed at contributors to this repo) with guidance on how to name diagnostic IDs and how to group diagnostics since these identifiers would become user-facing.
  • Go through all existing diagnostics to:
    • Organize them into meaningful groups
    • Remove the "org.swift.docc." prefix from their current identifiers—so that developers don't need to write that when controlling the severity of individual warnings
    • Rephrase the current identifiers to be more consistently named and to follow the new documentation about naming diagnostic identifiers.

Dependencies

None

Testing

  • Add steps for how to test this once this feature is more complete.

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran the ./bin/test script and it succeeded
  • Updated documentation if necessary

@d-ronnqvist d-ronnqvist added enhancement Improvements or enhancements to existing functionality needs forum discussion Needs to be discussed in the Swift Forums labels Nov 13, 2025
@d-ronnqvist
Copy link
Contributor Author

I started this Forum thread to discuss the user-facing aspects of this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvements or enhancements to existing functionality needs forum discussion Needs to be discussed in the Swift Forums

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant