Skip to content

Allow to pass features to cargo install in rust hooks #3230

@Terseus

Description

@Terseus

search you tried in the issue tracker

rust features

describe your actual problem

The rust hooks execute cargo install --bins --root <root-dir> <packages> (taken from here) to install the hook, however if a hook wants to use a different set of features than its default features it can't because there's no way to pass either additional flags to the install command or a --features <features> to cargo command.

See JohnnyMorganz/StyLua#867 for a real world example where this has become a limitation.

It would be great to have a way to configure a hook to pass cargo additional features when building the hook's package.

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