Skip to content

Finding the path of the installed hooks #1468

@paw-lu

Description

@paw-lu

I love the library. Thanks for all of the great work here!

Is there a convenient way to find where the command is located for installed hooks? For some background I'm looking for ways to integrate pre-commit linters and formatters (flake8 and black) into VS Code by specifying the full path of the linter executable.

For example, if I use the flake8 hook

  - repo: https://gitlab.com/pycqa/flake8
    rev: 3.8.1
    hooks:
      - id: flake8

and run pre-commit install, once I attempt to commit a file pre-commit will create a virtual environment, install flake8, and run it against the staged file.

Is there a way to find where exactly this flake8 is located? I've found ~/.cache/pre-commit, but it's not obvious to me which repo and bin correspond to which hook.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions