Skip to content

Feature request: Release to PyPI to allow for local pre-commit execution #31

Open
@mikeweltevrede

Description

@mikeweltevrede

Hi, I was wondering if you would consider releasing this to PyPI to allow for local execution. This is required for some organizations, where the CI cannot reach out to Github to retrieve the hook.

Example usage for ruff:

repos:
  - repo: local
    hooks:
      - id:             ruff
        name:           Run ruff linter
        entry:          ruff
        args:           [ "check", "--no-cache" ]
        language:       python
        types:          [ file, python ]
        files:          .*\.py$

If I use the following to try and use the regular uv lock (file names are provided to specify it should run only when one of those files is changed):

      - id:             check-uv-lock
        name:           UV lock file check
        entry:          uv lock --check
        language:       python
        files:          pyproject\.toml|uv\.lock

then notice that the file name is passed to the hook and it fails, which is of course the expected behaviour:

UV lock file check.......................................................Failed
- hook id: check-uv-lock
- exit code: 2

error: unexpected argument 'pyproject.toml'' found

Usage: uv lock [OPTIONS]

For more information, try '--help'.

Not providing files does not solve the problem, because then the hook is run on all files and their names are passed to uv lock as well.

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