Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

tweaks and fixes for doc(include) #46858

Merged
merged 5 commits into from
Dec 22, 2017

Conversation

QuietMisdreavus
Copy link
Member

This PR makes a handful of changes around #[doc(include="file.md")] (#44732):

  • Turns errors when loading files into full errors. This matches the original RFC text.
  • Makes the missing_docs lint check for #[doc(include="file.md")] as well as regular #[doc="text"] attributes.
  • Loads files included by #[doc(include="file.md")] into dep-info, mirroring the behavior of include_str!() and friends.
  • Adds or modifies tests to check for all of these.

@rust-highfive
Copy link
Collaborator

r? @michaelwoerister

(rust_highfive has picked a reviewer for you, use r? to override)

@jonhoo
Copy link
Contributor

jonhoo commented Dec 20, 2017

Hmm, I wonder if the missing_docs check also needs to test if the included file is empty. Otherwise, arguably, docs are indeed missing.

@SimonSapin
Copy link
Contributor

@jonhoo What happens with #[doc = ""] or ///?

@kennytm kennytm added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 20, 2017
@QuietMisdreavus
Copy link
Member Author

Right now, empty doc comments and doc attributes will satisfy the missing_docs lint. I can go ahead and add a check for doc attributes that are empty, but that would be an additional enhancement to the missing_docs lint, not just updating it to work for doc(include).

@SimonSapin
Copy link
Contributor

I think that an empty included doc file should be consistent with empty doc-comments. If we want to change what that does, maybe discuss it in a separate issue or PR.

@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Dec 20, 2017

📌 Commit cbbb73b has been approved by estebank

@kennytm kennytm added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 20, 2017
@frewsxcv
Copy link
Member

@bors rollup

kennytm added a commit to kennytm/rust that referenced this pull request Dec 21, 2017
… r=estebank

tweaks and fixes for doc(include)

This PR makes a handful of changes around `#[doc(include="file.md")]` (rust-lang#44732):

* Turns errors when loading files into full errors. This matches the original RFC text.
* Makes the `missing_docs` lint check for `#[doc(include="file.md")]` as well as regular `#[doc="text"]` attributes.
* Loads files included by `#[doc(include="file.md")]` into dep-info, mirroring the behavior of `include_str!()` and friends.
* Adds or modifies tests to check for all of these.
bors added a commit that referenced this pull request Dec 21, 2017
Rollup of 14 pull requests

- Successful merges: #46636, #46780, #46784, #46809, #46814, #46820, #46839, #46847, #46858, #46878, #46884, #46890, #46898, #46918
- Failed merges:
@bors bors merged commit cbbb73b into rust-lang:master Dec 22, 2017
@QuietMisdreavus QuietMisdreavus deleted the external-doc-error branch January 12, 2018 19:09
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants