Skip to content

Should the pre-commit hook call cargo-sort with --workspace? #120

@jwodder

Description

@jwodder

If cargo-sort (without arguments) is run in a workspace, the -w/--workspace option needs to be passed in order to sort the Cargo.toml files for all packages; in particular, users of the cargo-sort pre-commit hook currently have to add args: ["--workspace"] to their pre-commit config in order to get the behavior that I am sure 99% of users expect. On the other hand, in a non-workspace, adding the --workspace option does not seem to produce a change in behavior or any adverse effects. It would thus seem to make things all around more convenient if args: ["--workspace"] were added to .pre-commit-hooks.yaml — or is there some reason not to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions