0

I am trying to set up a pre-push hook using pre-commit https://pre-commit.com/ when i make a pre-commit hook it works fine like before commit all the checks work but in case of push no hook runs This is how my .pre-commit-config-yaml looks like in case of push

-   repo: local
    hooks:
    -   id: Test
        name: Test
        stages: [push]
        entry: python3 test.py
        language: system
        types: [python]

Does anyone know what am doing wrong?

Origin
  • 1,182
  • 1
  • 10
  • 25
  • did you make sure to `pre-commit install --hook-type pre-push` – anthony sottile Nov 06 '19 at 16:15
  • i had done this but still it was test running. I created a new repo , added this and did pre-commit install --hook type pre-push its working now.Thanks for the help :) @AnthonySottile – Origin Nov 07 '19 at 06:23
  • one more thing do you know how the structure of my test.py should be, now its returning " passed " every-time, what should i do so that when a particular condition comes it fails – Origin Nov 07 '19 at 06:26
  • From [creating new hooks](https://pre-commit.com/#new-hooks): > The hook must exit nonzero on failure or modify files in the working directory – anthony sottile Nov 07 '19 at 08:17
  • Got it thanks a lot – Origin Nov 07 '19 at 11:06

0 Answers0