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

cargo-fmt and cargo-clippy are not documented in The Cargo Book #14640

Closed
WorikWork opened this issue Oct 3, 2024 · 4 comments · Fixed by #14669
Closed

cargo-fmt and cargo-clippy are not documented in The Cargo Book #14640

WorikWork opened this issue Oct 3, 2024 · 4 comments · Fixed by #14669
Labels
A-documenting-cargo-itself Area: Cargo's documentation C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-clippy Command-fmt S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

Comments

@WorikWork
Copy link

Problem

I am looking for documentation on cargo fmt

So I came to here

It is an undocumented Cargo command.

It seems like a good place to document it.

thank you

Proposed Solution

No response

Notes

No response

@WorikWork WorikWork added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage. labels Oct 3, 2024
@epage
Copy link
Contributor

epage commented Oct 3, 2024

Neither is cargo clippy. They aren't built in commands but extension that get installed when you install those rustup components.

@WorikWork
Copy link
Author

Neither is cargo clippy. They aren't built in commands but extension that get installed when you install those rustup components.

Really? Ok.

I changed the title of the issue to reflect that.

I am raising this simply because this is where I came, and it seems a logical place to come (the Cargo Book) to find the documentation for the tools I use Cargo for.

@weihanglo
Copy link
Member

We could technically put a link to each external command in new HTML pages. However there are things worth noting:

  • None of them (cargo-fmt and cargo-clippy) has a man page like documentation in their repository (rust-lang/rustfmt and rust-lang/rust-clippy) for us to link to.
  • The man page style docs are also accessible via cargo help <cmd> in your terminal emulator. We can't link to arbitrary format if their man pages are available. Those man pages are generated from the source here https://github.com/rust-lang/cargo/tree/master/src/doc.
  • The Cargo team (maintainers of this repo) has no control over cargo-fmt and cargo-clippy in those repositories. The maintainers of those two repos can indeed write some man page docs in rust-lang/cargo repo, though it would be a burden to keep things sync in different repos.
  • There are some discussion about moving cargo-fmt/cargo-clippy into Cargo as built-in commands, though it is not going to happen anytime sooner.

@weihanglo weihanglo added S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted. Command-fmt Command-clippy A-documenting-cargo-itself Area: Cargo's documentation and removed S-triage Status: This issue is waiting on initial triage. labels Oct 4, 2024
@weihanglo
Copy link
Member

We might have a possible way forward at this moment:

Writing a static markdown for cargo fmt and cargo clippy only for HTML documentation at https://doc.rust-lang.org/cargo/. For each page, explain it is an external subcommand and is available via rustup component add. Also provide a link to https://doc.rust-lang.org/clippy/installation.html or https://github.com/rust-lang/rustfmt (sorry I cannot find the official doc for rustfmt under doc.rust-lang.org).

@weihanglo weihanglo changed the title Cargo book chapter 4 does not document fmt cargo-fmt and cargo-clippy are not documented in The Cargo Book Oct 4, 2024
@bors bors closed this as completed in e8adba9 Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documenting-cargo-itself Area: Cargo's documentation C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-clippy Command-fmt S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants