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

Suggestion: Better documentation/error-messages with try repo --commit-msg-filename #2394

Closed
AndersSteenNilsen opened this issue May 15, 2022 · 1 comment

Comments

@AndersSteenNilsen
Copy link

search tried in the issue tracker

stages: [commit-msg] --commit-msg-filename

describe your issue

I am trying to make a hook that checks commit messages. I tried to use the try-repo together with --commit-msg-filename. I passed an arbitrary filename and did not realize that this file actually needs to exist.
I might be stupid for not realizing this earlier, but in order to ease the pain for others, if the file does not exists, maybe pass the filename to the hook in any case or maybe raise an exception.

Added .pre-commit-hooks.yaml.

pre-commit --version

pre-commit 2.19.0

.pre-commit-config.yaml

-   id: auto-git-messsage
    name: Generate git message
    description: This hook trims trailing whitespace.
    entry: create_message
    language: python
    stages: [commit-msg]

~/.cache/pre-commit/pre-commit.log (if present)

No response

@asottile
Copy link
Member

unfortunately can't change this without breaking things. missing files are intentionally skipped

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

No branches or pull requests

2 participants