Skip to content

Detect missing arg for prepare-commit-msg and commit-msg#1341

Merged
asottile merged 1 commit intopre-commit:masterfrom
particledecay:catch_commit-msg_missing_arg
Feb 23, 2020
Merged

Detect missing arg for prepare-commit-msg and commit-msg#1341
asottile merged 1 commit intopre-commit:masterfrom
particledecay:catch_commit-msg_missing_arg

Conversation

@particledecay
Copy link
Copy Markdown
Contributor

@particledecay particledecay commented Feb 22, 2020

If using the prepare-commit-msg and commit-msg stages specifically (such as with the try-repo command), the --commit-msg-filename arg must be provided.

Resolves #1336

Comment thread pre_commit/commands/run.py Outdated
@particledecay particledecay force-pushed the catch_commit-msg_missing_arg branch from 9f217f4 to fc8ced7 Compare February 23, 2020 04:30
If using the prepare-commit-msg and commit-msg stages specifically (such
    as with the try-repo command), the `--commit-msg-filename` arg must be
provided.

[fixes pre-commit#1336]

chore: improve error message for hook stage check
@asottile asottile force-pushed the catch_commit-msg_missing_arg branch from fc8ced7 to 5258dce Compare February 23, 2020 18:16
@asottile
Copy link
Copy Markdown
Member

I went ahead and:

  • fixed the linting (lol)
  • added a test
  • fixed the test which was inadvertently tickling this change

Copy link
Copy Markdown
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asottile asottile merged commit 05f486e into pre-commit:master Feb 23, 2020
@particledecay
Copy link
Copy Markdown
Contributor Author

Nice... admittedly I was trying to familiarize myself with all the functions you're using in your unit tests but I just haven't had the time this weekend.

@asottile
Copy link
Copy Markdown
Member

no problem! patch looked good and I wanted to build on it in some other PRs which would have conflicted

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

TypeError: expected string or bytes-like object

2 participants