Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature idea: lint workspace dependencies #6

Open
yaymukund opened this issue Mar 4, 2023 · 1 comment
Open

Feature idea: lint workspace dependencies #6

yaymukund opened this issue Mar 4, 2023 · 1 comment

Comments

@yaymukund
Copy link

Hi Timon, big fan of your crates, had this idea:

  1. In cargo_fmt_manifest.toml:

    workspace-only-dependencies = [
        "clap",
        "crossterm",
        "tokio",
    ]
  2. This should now be an error:

    [dependencies]
    clap = "4.1"

    e.g.:

    Error: clap is defined at the workspace level, yet its version is specified as "4.1". Please specify it
    as clap = { workspace = true }. See:

    https://doc.rust-lang.org/cargo/reference/workspaces.html#the-dependencies-table

    Hmm, the error message should probably also mention the workspace-only-dependencies array.

What do you think?

@TimonPost
Copy link
Owner

TimonPost commented Mar 4, 2023

Glad you like them! Seems like something this crate can eventually have. Although its core focus in on formatting I wanted to do some linting as well. Would be nice to have a simple lint for this as well

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants