Skip to content

Consider adding a checklist / lints of best practices #4095

@Susurrus

Description

@Susurrus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Error and warning messages generated by Cargo itself.S-needs-mentorStatus: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions