Skip to content

migrate rust language's addition-dependencies to use cargo install #3278

@2bndy5

Description

@2bndy5

search you tried in the issue tracker

rust

describe your actual problem

This is following the discussion about allowing cargo features to be used in rust-based hooks (started in #3230 continued in #3235).

The cargo add command has been used since 2018 to add dependencies to a rust-based hook's manifest (Cargo.toml). Sometime since then (probably when 2021 edition was stabalized), cargo features were implemented in the cargo install command. As noted in #3235 (comment), this makes cargo install more suitable for a rust-based hook's additional-dependencies because it actually installs additionally specified dependencies.

Tip

Using --locked better assures expected install behavior. However, this is not the default for cargo install.

pre-commit --version

3.7.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions