Skip to content

[Bug]: pre-commit with staged changes to only not supported files makes the hook fail #82

@BjarkeHautop

Description

@BjarkeHautop

Component

Other

Panache Version

2.20

Operating System

Linux Mint 22.3

Description

If using the default pre-commit hook from docs

repos:
  - repo: https://github.com/jolars/panache
    rev: v2.22.0
    hooks:
      - id: panache-format
      - id: panache-lint

and the only staged changes are for files not included in format/linter then the precommit hook will fail. E.g., if the only staged changes are panache.toml.

Input Document

Stage changes for a file not included in format/linter, e.g. panache.toml and have the default pre-commit hook from docs.

Expected Output

That the precommit hook doesn't fail.

Actual Output

panache format...........................................................Failed
- hook id: panache-format
- exit code: 1

Error: No supported files found

panache lint.............................................................Failed
- hook id: panache-lint
- exit code: 1

Error: No supported files found

Configuration

flavor = "quarto"

extend-exclude = ["tests/testthat/_snaps/", "LICENSE.md", "README.md"]

[linters]
r = "jarl"

[formatters]
r = "air"

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreleased

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions