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

[Merged by Bors] - Doc warnings #2577

Closed
wants to merge 6 commits into from

Conversation

Hoidigan
Copy link
Contributor

Fixes #2576

Add <> to links where needed, fix typo and refactored names, and add docs.rs links for external items.

Made the links clickable by surrounding with <>, which
should stop the warnings of "use an automatic link instead"
This is by adding a link to the docs.rs pages for external structs.
Fix links that are (theoritically) broken due to typos and refactoring.
@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Jul 31, 2021
@alice-i-cecile
Copy link
Member

bors try

bors bot added a commit that referenced this pull request Jul 31, 2021
@alice-i-cecile alice-i-cecile added C-Code-Quality A section of code that is hard to understand or change C-Docs An addition or correction to our documentation and removed S-Needs-Triage This issue needs to be labelled labels Jul 31, 2021
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Jul 31, 2021
@bors
Copy link
Contributor

bors bot commented Jul 31, 2021

try

Build failed:

@alice-i-cecile
Copy link
Member

bors try

bors bot added a commit that referenced this pull request Jul 31, 2021
@Hoidigan
Copy link
Contributor Author

Hoidigan commented Aug 4, 2021

@cart Could I get the workflow run for this? I can't do it since I'm a first time contributor.

@alice-i-cecile
Copy link
Member

bors try

bors bot added a commit that referenced this pull request Aug 4, 2021
@bors
Copy link
Contributor

bors bot commented Aug 4, 2021

try

Build failed:

@Hoidigan
Copy link
Contributor Author

Hoidigan commented Aug 4, 2021

What should I do to get that to work?
It says to run cargo fmt --all, which modifies uh... 408 files, it looks like.
And whatever the dependencies issue is?
(also thank you 😄)

@alice-i-cecile
Copy link
Member

@Hoidigan, clicking through, I'm seeing

error: failed to download from https://crates.io/api/v1/crates/ab_glyph_rasterizer/0.1.4/download

Caused by:
[55] Failed sending data to the peer (Connection died, tried 5 times before giving up)
Error: Process completed with exit code 101.

Looks like a networking error that isn't your fault. #2040 has more contributing advice for you though; it's just waiting on final review now <3

@alice-i-cecile
Copy link
Member

bors try

bors bot added a commit that referenced this pull request Aug 5, 2021
@bors
Copy link
Contributor

bors bot commented Aug 5, 2021

try

Build succeeded:

/// Usually the main loop is handled by Bevy integrated plugins ([`WinitPlugin`]), but
/// in some cases one might wish to implement their own main loop.
/// Usually the main loop is handled by Bevy integrated plugins
/// ([`WinitPlugin`](https://docs.rs/bevy_winit/0.5.0/bevy_winit/struct.WinitPlugin.html)),
Copy link
Member

Choose a reason for hiding this comment

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

full links to docs.rs should be avoided

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What should I change it to get the correct link? Replace the 0.5.0 with *?
We can't point it to WinitPlugin from inside that crate, because it doesn't have that as a dependency.

Copy link
Member

Choose a reason for hiding this comment

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

you should be able to add a dev dependencies to bevy_winit that will allow doc links to work 😃

Copy link
Contributor Author

@Hoidigan Hoidigan Aug 9, 2021

Choose a reason for hiding this comment

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

I don't think it does... It doesn't bring it into scope for the doc comments. I'm fairly certain we'd have to bring it in as a full dependency.
rust-lang/api-guidelines#186

Oh here we are, I was trying to dig and find this! https://discord.com/channels/691052431525675048/743559241461399582/871090893162156082

Copy link

Choose a reason for hiding this comment

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

Cargo doesn't provide dev-dependencies when documenting. @Nemo157 has suggested doc-dependencies a few times but it doesn't currently exist.

See also rust-lang/rust#74481.

Copy link
Member

Choose a reason for hiding this comment

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

Oh right, dev dependencies are available when testing doc code blocks but not when building docs...

The other place where we have a similar link is

/// [`App::add_event`]: https://docs.rs/bevy/*/bevy/app/struct.App.html#method.add_event

If we consider than the main target for those links will be docs.rs users, I think it should link to the root crate (bevy instead of bevy_winit) and use * for version. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that sounds good, I'll go through and do that.

@mockersf
Copy link
Member

@Hoidigan could you run cargo fmt to fix format?

@Hoidigan
Copy link
Contributor Author

I should be able to this Sunday, sorry about the wait. I'm away and don't have my computer

@Hoidigan
Copy link
Contributor Author

Hoidigan commented Sep 13, 2021

(Sorry I'm a bit slow)

Running cargo fmt --all modifies all 408 files. I only committed the changes in the 3 files that the ci complained about, but that was little weird. I think it was newline issues, but I don't actually know.
(edit for clarity.)

@mockersf
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Sep 14, 2021
Fixes #2576 

Add <> to links where needed, fix typo and refactored names, and add docs.rs links for external items.
bors bot pushed a commit that referenced this pull request Sep 14, 2021
Fixes #2576 

Add <> to links where needed, fix typo and refactored names, and add docs.rs links for external items.
@bors bors bot changed the title Doc warnings [Merged by Bors] - Doc warnings Sep 14, 2021
@bors bors bot closed this Sep 14, 2021
@Hoidigan Hoidigan deleted the doc-warnings branch September 15, 2021 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Code-Quality A section of code that is hard to understand or change C-Docs An addition or correction to our documentation S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation warnings
5 participants