Skip to content

Enable parameter and return value validation by default #882

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

Conversation

d-ronnqvist
Copy link
Contributor

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

Summary

This enables DocC's processing and validation of parameter and return value documentation by default.

It also uses this flag to fix the new warnings in DocC about incorrectly documented parameters or return values.

Lastly, it adds an article that describe the basics of documenting multi-source-language API and describe the new parameter and return value behaviors.

Dependencies

None.

Testing

The steps described in #776 now apply by default.

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

Copy link
Contributor

@patshaughnessy patshaughnessy left a comment

Choose a reason for hiding this comment

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

Amazing how many inconsistencies this feature found in the DocC docs 👍

/// Begins the given metric.
/// - Parameters:
/// - metric: The metric to begin measuring.
/// - log: The log that may filter out the metric.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add a Returns: doc comment for this function also?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The goal of this PR isn't to extensively document all the parameters and return values, only to fix the warnings about mis-documented parameters or return values.

@@ -104,7 +104,6 @@ public struct CoverageDataEntry: CustomStringConvertible, Codable {
}

/// Outputs a short table summarizing the coverage statistics for a list of data entries.
/// - Parameter coverageInfo: An array of entries to summarize.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove this?

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 it's an experimental API that result in warnings about not having all of its parameters documented.

Comment on lines -26 to -27
- ``defaultCodeListingLanguage``
- ``defaultAvailability``
Copy link
Contributor

Choose a reason for hiding this comment

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

Why removing these symbols from here? There are also part of the Documentation Bundle.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are not. These links don't resolve to anything.

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist d-ronnqvist merged commit a2d3f59 into swiftlang:main Apr 24, 2024
@d-ronnqvist d-ronnqvist deleted the validate-parameter-docs-by-default branch April 24, 2024 16:25
d-ronnqvist added a commit to d-ronnqvist/swift-docc that referenced this pull request Apr 24, 2024
* Enable parameter and return value validation by default

rdar://125835874

* Remove various links to symbols that no longer exist

* Fix warnings about undocumented parameters

* Add article about documenting multi-source-language APIs

* Fix additional warnings about undocumented parameters

* Refine the synthesized content phrasing for ObjC API with errors

rdar://125835874

* Clarify documentation about documenting return values.

* Update example error documentation

* Rename feature flag to remove "experimental"

* Remove redundant test setup

* Fix test that documented parameters that the symbol didn't have

* Fix test that was expecting the wrong number of diagnostics

* Add license comment to new documentation article
emilyychenn pushed a commit to emilyychenn/swift-docc that referenced this pull request Apr 30, 2024
* Enable parameter and return value validation by default

rdar://125835874

* Remove various links to symbols that no longer exist

* Fix warnings about undocumented parameters

* Add article about documenting multi-source-language APIs

* Fix additional warnings about undocumented parameters

* Refine the synthesized content phrasing for ObjC API with errors

rdar://125835874

* Clarify documentation about documenting return values.

* Update example error documentation

* Rename feature flag to remove "experimental"

* Remove redundant test setup

* Fix test that documented parameters that the symbol didn't have

* Fix test that was expecting the wrong number of diagnostics

* Add license comment to new documentation article
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