Skip to content

[Diagnostics] Eliminate educational notes in favor of diagnostic groups #80391

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

Conversation

DougGregor
Copy link
Member

We've been converging the implementations of educational notes and diagnostic groups, where both provide category information in diagnostics (e.g., [#StrictMemorySafety]) and corresponding short-form documentation files. The diagnostic group model is more useful in a few ways:

  • It provides warnings-as-errors control for warnings in the group
  • It is easier to associate a diagnostic with a group with GROUPED_ERROR/GROUPED_WARNING than it is to have a separate diagnostic ID -> mapping.
  • It is easier to see our progress on diagnostic-group coverage
  • It provides an easy name to use for diagnostic purposes.

Collapse the educational-notes infrastructure into diagnostic groups, migrating all of the existing educational notes into new groups. Simplify the code paths that dealt with multiple educational notes to have a single, possibly-missing "category documentation URL", which is how we're treating this.

We've been converging the implementations of educational notes and
diagnostic groups, where both provide category information in
diagnostics (e.g., `[#StrictMemorySafety]`) and corresponding
short-form documentation files. The diagnostic group model is more
useful in a few ways:

* It provides warnings-as-errors control for warnings in the group
* It is easier to associate a diagnostic with a group with
GROUPED_ERROR/GROUPED_WARNING than it is to have a separate diagnostic
ID -> mapping.
* It is easier to see our progress on diagnostic-group coverage
* It provides an easy name to use for diagnostic purposes.

Collapse the educational-notes infrastructure into diagnostic groups,
migrating all of the existing educational notes into new groups.
Simplify the code paths that dealt with multiple educational notes to
have a single, possibly-missing "category documentation URL", which is
how we're treating this.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor enabled auto-merge March 29, 2025 20:54
@DougGregor
Copy link
Member Author

Huh.

FAIL: Swift(macosx-x86_64) :: Python/python_lint.swift (6074 of 18893)
******************** TEST 'Swift(macosx-x86_64) :: Python/python_lint.swift' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
./utils/dev-scripts/scurve_printer.py:17:5: F824 `global FIELDS` is unused: name is never assigned in scope
./utils/swift_build_sdk_interfaces.py:242:5: F824 `global args` is unused: name is never assigned in scope
./utils/swift_build_sdk_interfaces.py:242:5: F824 `global shared_output_lock` is unused: name is never assigned in scope
./utils/symbolicate-linux-fatal:78:5: F824 `global known_memmap` is unused: name is never assigned in scope
./utils/symbolicate-linux-fatal:93:5: F824 `global lldb_target` is unused: name is never assigned in scope
./utils/symbolicate-linux-fatal:117:5: F824 `global lldb_target` is unused: name is never assigned in scope
./utils/symbolicate-linux-fatal:118:5: F824 `global known_memmap` is unused: name is never assigned in scope
./utils/type-layout-fuzzer.py:46:9: F824 `global typesDefined` is unused: name is never assigned in scope
./utils/type-layout-fuzzer.py:88:5: F824 `global classesDefined` is unused: name is never assigned in scope

@DougGregor
Copy link
Member Author

This ended up getting merged as part of #80392

@DougGregor DougGregor closed this Mar 31, 2025
auto-merge was automatically disabled March 31, 2025 21:26

Pull request was closed

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.

1 participant