Skip to content

python -m pre_commit does not work #80

@ssbarnea

Description

@ssbarnea

I found at least one case where pre-commit will be called without patching and decide to recreate the environments.

[tool.tox.env.lint]
description = "Run all linters"
commands_pre = []
commands = [
  ["{env_python}", "-m", "pre_commit", "run", "--all-files", "--show-diff-on-failure"],
  ["pre-commit", "run", "--all-files", "--show-diff-on-failure"]
]

First line does not use pre-commit-uv, but the second one does. As there are good reasons for using python -m calling inside tox config and other places, it would be useful to have an pre_commit_uv option too.

Is there anything preventing us from exposing a pre-commit-uv command and allowing the module to be called?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions