-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
STYLE,BUG: autotyping hook fails if run on no files #48808
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
Comments
Could it be that pre-commit runs autotyping even though no py/pyi files were changed? edit: |
@JelleZijlstra I assume it would be out of your control to allow no paths as autotyping is wrapped inside LibCST? |
Yes, the current setup makes it hard. I think it should be possible to change autotyping so that it's invoked as |
I think the issue's just that autotyping wants files and then (pandas-dev) marcogorelli@DESKTOP-U8OKFP3:~/pandas-dev$ python -m libcst.tool codemod autotyping.AutotypeCommand pandas/compat/pickle_compat.py --aggressive
Calculating full-repo metadata...
Executing codemod...
All done! ✨ 🍰 ✨
1 file left unchanged.
Finished codemodding 1 files!
- Transformed 1 files successfully.
- Skipped 0 files.
- Failed to codemod 0 files.
- 0 warnings were generated.
(pandas-dev) marcogorelli@DESKTOP-U8OKFP3:~/pandas-dev$ python -m libcst.tool codemod autotyping.AutotypeCommand --aggressive pandas/compat/pickle_compat.py
usage: libcst.tool codemod [-h] [-j JOBS] [-p VERSION] [-u [CONTEXT]] [--include-generated] [--include-stubs] [--no-format] [--show-successes]
[--hide-generated-warnings] [--hide-blacklisted-warnings] [--hide-progress]
[--annotate-optional [ANNOTATE_OPTIONAL [ANNOTATE_OPTIONAL ...]]]
[--annotate-named-param [ANNOTATE_NAMED_PARAM [ANNOTATE_NAMED_PARAM ...]]] [--none-return] [--scalar-return] [--bool-param]
[--int-param] [--float-param] [--str-param] [--bytes-param] [--annotate-magics] [--annotate-imprecise-magics]
[--pyanalyze-report PYANALYZE_REPORT] [--only-without-imports] [--safe [SAFE]] [--aggressive [AGGRESSIVE]]
COMMAND PATH [PATH ...]
libcst.tool codemod: error: the following arguments are required: PATH IMO simplest thing would be to just have a local script that runs it |
Not sure why yet, but here's what I got after a commit:
This hook was added in #48191
cc @twoertwein in case you've come across this before (I'll have a look later anyway, just opening an issue for now)
The text was updated successfully, but these errors were encountered: