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

pytype hook fails when only test files are updated. #4

Open
abadger opened this issue May 31, 2022 · 0 comments
Open

pytype hook fails when only test files are updated. #4

abadger opened this issue May 31, 2022 · 0 comments

Comments

@abadger
Copy link

abadger commented May 31, 2022

I have a commit that only updates unit_test files. The pytype hook fails with a usage error:

pytype.......................................................................Failed
- hook id: pytype
- exit code: 2

usage: pytype [options] input [input ...]
pytype: error: Need an input.

I think that pre-commit ci must be invoking pytype because there are .py files in the commit but something is also removing the files from the invocation because they are in a tests/** subdirectory. Maybe the wrapper needs to be slightly heavier weight so that it can check whether there are any files before running pytype.

abadger added a commit to abadger/suds that referenced this issue May 31, 2022
The pre-commit pytypes wrapper we're using has a bug.  When only
unittest files are in the commit, pytype is invoked with no files:
mattseymour/pre-commit-pytype#4

Workaround this for now by adding the suds directory to the arguments
for pytype.  This is a bit to heavyweight to be a good general solution
so hopefully the author will find a better way (or I could add a pytpe
hook to captain_hooks)
abadger added a commit to abadger/suds that referenced this issue May 31, 2022
The pre-commit pytypes wrapper we're using has a bug.  When only
unittest files are in the commit, pytype is invoked with no files:
mattseymour/pre-commit-pytype#4

Workaround this for now by adding the suds directory to the arguments
for pytype.  This is a bit to heavyweight to be a good general solution
so hopefully the author will find a better way (or I could add a pytpe
hook to captain_hooks)
abadger added a commit to abadger/suds that referenced this issue May 31, 2022
The pre-commit pytypes wrapper we're using has a bug.  When only
unittest files are in the commit, pytype is invoked with no files:
mattseymour/pre-commit-pytype#4

Workaround this for now by adding the suds directory to the arguments
for pytype.  This is a bit to heavyweight to be a good general solution
so hopefully the author will find a better way (or I could add a pytpe
hook to captain_hooks)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant