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
TypeError: expected string or bytes-like object #1336
Comments
for the error message can probably be improved here please in the future include the full contents of |
would you like to work on improving the error message? |
Is that required flag in a doc somewhere? If not, I can submit a PR for it. |
@asottile also I'm not so sure it's an error message thing as much as it is an error. It's failing to find files, not failing intentionally, so while I'm not sure I'm familiar enough here to get the logic right for differentiating this specific failure scenario versus others (in different hook types, for instance), I can certainly take a crack at it. |
it's a user error and probably not documented beyond as for the code change here, it probably needs a check similar to this one here -- notably it needs to check that if |
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]
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
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
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
OS: Ubuntu 19.10
App Version: pre-commit 2.1.0
Trying to create a commit-msg hook with the following hook yaml:
However, when I run the
try-repo
command...The
pre-commit.log
file shows me this traceback:Looking through the code it looks like it's expecting to run the
filter_by_include_exclude()
method and it attempts to iterate overnames
which has a value of(None,)
. Not sure if this is expected behavior but I wouldn't expect a commit-msg hook to filter any files since the only thing it should get is the filename of the commit message?The text was updated successfully, but these errors were encountered: