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

Consider adding a checklist / lints of best practices #4095

Open
Susurrus opened this issue May 24, 2017 · 2 comments
Open

Consider adding a checklist / lints of best practices #4095

Susurrus opened this issue May 24, 2017 · 2 comments
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. S-needs-mentor Status: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.

Comments

@Susurrus
Copy link
Contributor

Right now there are several checks done by cargo publish. Unfortunately there isn't a concise list of the necessary requirements for publishing a crate. The only way to tell is cargo publish or cargo publish --dry-run. The latter is harder to discover. And once you detect and error, it could take a while to fix (like if you're using unversioned dependencies).

There are also higher-level best-practices that could be described to the user that they should follow. Ideally all of these would be checkable via lints within cargo itself. Some examples:

  • Check that there isn't a use_* feature where * is an existing crate name with underscores (from this issue)
  • That the crate has a std feature if this crate could expose functionality that made sense in a no_std environment.

Ideally this would be something that would be part of the publishing process for the first version of a crate and then could also be part of cargo publish --dry-run as a check in the future. I don't know if cargo checklist is a good name for this or it could all be contained within the cargo publish command.

@dwijnand
Copy link
Member

cargo doctor or (better yet) cargo self fix?

@epage epage added the S-needs-mentor Status: Issue or feature is accepted, but needs a team member to commit to helping and reviewing. label Oct 14, 2023
@epage epage changed the title Consider adding a checklist of best practices Consider adding a checklist / lints of best practices Oct 14, 2023
@epage
Copy link
Contributor

epage commented Oct 14, 2023

Once we have #12235, we are looking to expand the cargo-focused lints. Seems like this would be a good issue for tracking that effort.

btw there is a separate proposal for cargo doctor in #9341 but that is more of a self-check for cargo to see if there are problems.

@epage epage added A-lints Area: rustc lint configuration and removed A-documenting-cargo-itself Area: Cargo's documentation labels Oct 14, 2023
@epage epage added A-diagnostics Area: Error and warning messages generated by Cargo itself. and removed A-lints Area: rustc lint configuration labels Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. S-needs-mentor Status: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.
Projects
None yet
Development

No branches or pull requests

4 participants