hhatto / autopep8

A tool that automatically formats Python code to conform to the PEP 8 style guide.
https://pypi.org/project/autopep8/
MIT License
4.54k stars 291 forks source link

`--recursive` does not work for stub files #682

Open Avasam opened 1 year ago

Avasam commented 1 year ago

Python Code

N/A

Command Line

autopep8 ./types --in-place --recursive ☝Does not run on ./types/**/*.pyi files

Your Environment

asdawej commented 7 months ago

Notice the function is_python_file in autopep8.py; it's using the file suffix '.py' & shebang line to recognize a python file. So an expediency is to add a shebang line for your .pyi stub files.

But, a better answer is to modify the function and take .pyi suffix into account, I think.