Skip to content

pre-commit hook performs should performs a scan by default #2303

@pcastellazzi

Description

@pcastellazzi

When osv-scanner is running from a pre-commit hook without args it does not fail.

Steps to reproduce:

  1. Create a .pre-commit-config.yaml with the following content:
repos:
  - repo: https://github.com/google/osv-scanner/
    rev: "v2.2.3"
    hooks:
      - id: osv-scanner
  1. Run
pre-commit run --all-files --verbose osv-scanner
Image

I understand the documentation clearly states it should be used with args, but i would argue that, when that's not the case, the hook should fail.

The same behavior is observed when osv-scanner is run from the command line. 0 (zero) is returned as an exit code instead of non zero value.

This behavior hides mistakes like incorrect indentation on the pre-commit hook configuration or the all too common misspelled variable name in a bash script.

Metadata

Metadata

Assignees

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