-
Notifications
You must be signed in to change notification settings - Fork 163
Warn when an article would override a symbol page #1339
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
Warn when an article would override a symbol page #1339
Conversation
rdar://109177620
patshaughnessy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
Should we make this warning an error instead? Dropping an article entirely is a fairly dramatic problem, and maybe the author would miss the warning otherwise? ...for example if a Symbol was later introduced that happened to have the same name as an existing article?
|
@swift-ci please test |
I don't think this should be an error. This is how we've defined the error and warning severities:
In other words; errors stop the entire build and cause DocC to produce no output but warnings lets the build continue and allow DocC to produce some output. If we were to make this an error, then any project who was impacted by this issue but wasn't aware of it would completely fail to build from one version to the next. So, at the very least I'd think that we'd need to start as a warning to give developers time to address the issue before we break their documentation builds. Before adding this warning we would still drop a page. It would just be silent (no warning) and it would be nondeterministic if it was the symbol or the article that was lost. As far as I know; we don't have any actual error-severity diagnostics today. The only diagnostics that use an error severity as for unexpected errors in code that can't
We have other warning severity diagnostics today that drop entire files, for example:
Today, developers can pass the |
|
(for what it's worth after the fact, the "soundness" checks in the GitHub Actions for swiftlang projects explicitly run the documentation builds with --warning-as-error to identify problems such as this one, so a warning is perfect - allows the developer to iterate quickly, but there's a net to catch with the soundness checks) |
|
I opened this draft PR to allow developers to control the severity of specific diagnostics. I'll start a Forum discussion about it shortly. |
Bug/issue #, if applicable: rdar://109177620
Summary
This adds a warning when an article's output JSON file would override the output JSON file of a symbol. To get a deterministic behavior across builds, DocC favors the symbol over the article.
Other tests that verify behavior that happens earlier than the JSON rendering need to be modified to expect this behavior until rdar://79745455 / #593 is fixed.
Dependencies
None
Testing
In a project with some symbol documentation:
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/testscript and it succeeded