Skip to content

DiagnosticEngine: Fix escalation for wrapped diagnostics #78398

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

Merged
merged 4 commits into from
Jan 9, 2025

Conversation

AnthonyLatsis
Copy link
Collaborator

Wrapped diagnostics were not escalated to errors because the check was based on the diagnostic ID, which is that of the wrapper diagnostic in this case. Switch to tracking whether escalation was enabled for a given group instead.

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test macOS

@AnthonyLatsis
Copy link
Collaborator Author

cc @DmT021

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test macOS

void setWarningAsErrorForDiagID(DiagID id, bool value) {
/// Sets whether warnings belonging to the diagnostic group identified by
/// `id` should be escalated to errors.
void setWarningsAsErrorsForDiagGroupID(DiagGroupID id, bool value) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It took me a moment to understand why it's a valid change for the case when we apply WarningAsErrorRule with TargetAll. But it seems it's ok as all the uncategorized warnings have the no_group group which will be stored in this BitVector like the others.
I'd leave a comment about it though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure. Will add a test too.

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test macOS

@AnthonyLatsis AnthonyLatsis requested a review from DmT021 January 7, 2025 10:41
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.

This looks great, thank you!

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test

…ostic group

This group has not shipped yet and was added mainly to support test
coverage for d56b7df. Now that we have
unit tests for this, delete the group, pending discussion.
@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test Linux

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test

1 similar comment
@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test

@AnthonyLatsis AnthonyLatsis merged commit eb428be into swiftlang:main Jan 9, 2025
3 checks passed
@AnthonyLatsis AnthonyLatsis deleted the micronecta-scholtzi branch January 9, 2025 14:22
@AnthonyLatsis AnthonyLatsis changed the title DiagnosticEngine: Fix diagnostic groups behavior for wrapped diagnostics DiagnosticEngine: Fix escalation for wrapped diagnostics Jan 9, 2025
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.

3 participants