Skip to content

Hooks should fail on missing dependencies #19

@wingsofovnia

Description

@wingsofovnia

Currently, if dependencies (e.g. goimports or gofumpt) are missing, the hooks do not report valid error code to pre-commit and it fails silently, which is only detected if --verbose is passed.

> pre-commit run --all-files --show-diff-on-failure --verbose
...
go import/fmt............................................................Passed
- hook id: go-fmt-import
- duration: 0s

/home/vsts/work/1/pre-commit-cache/repok815yl26/run-go-fmt-import.sh: 3: goimports: not found

/home/vsts/work/1/pre-commit-cache/repok815yl26/run-go-fmt-import.sh: 3: goimports: not found

gofumpt..................................................................Passed
- hook id: gofumpt
- duration: 0s

/home/vsts/work/1/pre-commit-cache/repok815yl26/run-go-gofumpt.sh: 3: gofumpt: not found

/home/vsts/work/1/pre-commit-cache/repok815yl26/run-go-gofumpt.sh: 3: gofumpt: not found

As you can see, pre-commit reports Passed although the hook failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions