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

Formally deprecate the old diagnostics.json digest file #1163

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

d-ronnqvist
Copy link
Contributor

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

Summary

This formally deprecates the old "diagnostics.json" digest file that DocC writes when passed the --emit-digest flag.

This file has superseded by the --diagnostics-file, --diagnostics-output-path <diagnostics-file> file since March 2023 (by #494).

With these changes, the deprecated "diagnostics.json" digest file will contain an additional warning that this file is deprecated and will be removed. However, if there are no warnings or errors, the file won't include this deprecation warning to avoid interfering with older systems who read this file as an indication that the build has warnings or not.

Dependencies

None.

Testing

Build any documentation that produces at least one warning and pass the --emit-digest flag.

Inspect the "diagnostics.json" file inside the documentation output. There should be a warning that this file is deprecated and will be removed.

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

Comment on lines +68 to +72
package protocol _DeprecatedConsumeProblemsAccess {
func _consume(problems: [Problem]) throws
}

package struct _Deprecated<Consumer: ConvertOutputConsumer>: _DeprecatedConsumeProblemsAccess {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because ConvertOutputConsumer is a public protocol I had to get a bit creative to be able to still call its deprecated API without introducing deprecation warnings in the DocC code.

@@ -21,7 +21,6 @@ class TestRenderNodeOutputConsumer: ConvertOutputConsumer {
}
}

func consume(problems: [Problem]) throws { }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This tests that conforming types can omit implementing the deprecated method.

@d-ronnqvist d-ronnqvist force-pushed the deprecate-old-diagnostics-digest-file branch from 67ee22a to 15ac29e Compare February 27, 2025 16:56
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