Skip to content

Encourage the use of the repository field in Cargo.toml #14139

Open
@szabgab

Description

@szabgab

Problem

Having the repository field in Cargo.toml of an open source Rust project will make it easier to contribute to the project.
According to my analysis on Rust-Digger, 19.03% of the crates don't have the repository field.

Some of those ~ 2.23% use the homepage field to link to the repository. It is better than nothing, but ideally people would use the repository field. See stats: https://rust-digger.code-maven.com/stats

Proposed Solution

Adding

# repository = ""

to the generated Cargo.toml file will probably encourage more people to enable it and use it to link to the repository.

In addition including a commented out link to the documentation of the manifest would also help https://doc.rust-lang.org/cargo/reference/manifest.html

Finally, cargo publish might give a warning if the repository field is missing or if it is empty

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-packageS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions