Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Talisman broken with pre-commit because the executable is not included #432

Open
mpicard opened this issue Aug 2, 2023 · 1 comment
Open

Comments

@mpicard
Copy link

mpicard commented Aug 2, 2023

Describe the bug

When I run pre-commit run --all-files I get an error because the Talisman executable is not found. This is unconventional for a pre-commit hook. It says in the docs:

pre-commit currently supports hooks written in many languages. As long as your git repo is an installable package (gem, npm, pypi, etc.) or exposes an executable, it can be used with pre-commit.

source

Talisman is not installable with one of the supported package managers and it doesn't expose the binary because it assumes you already have it installed, which is not the way pre-commit hooks are supposed to work.

To Reproduce
Steps to reproduce the behavior:

  1. (on a new machine) install pre-commit
  2. add a .pre-commit-config.yaml with:
repos:
- repo: https://github.com/thoughtworks/talisman
   rev: v1.31.0
   hooks:
    - id: talisman-commit
  1. run pre-commit run --all-files (or commit something to trigger pre-commit)
  2. See error

Expected behavior

pre-commit works as intended and executes talisman and exit 0 (if no secrets are found) as expected behavior of pre-comimt

Screenshots

Screenshot 2023-08-02 at 17 30 58

Desktop (please complete the following information):

  • OS: MacOS Ventura
@ColdFire87
Copy link

ColdFire87 commented Sep 14, 2023

got the same issue with v1.31.0 in Win 11 + WSL2

Found a workaround from the pre-commit author here -> https://stackoverflow.com/a/68803356/5285606

repos:
  - repo: https://github.com/thoughtworks/talisman
    rev: v1.31.0
    hooks:
      - id: talisman-commit
        entry: cmd --githook pre-commit
      - id: talisman-push
        entry: cmd --githook pre-commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants