Closed jakkdl closed 1 year ago
It seems odd that autoflake ignores .pyi files. Surely pyflakes and autoflake will run fine on type stubs.
Black also has a separate .pyi formatting mode, but I think the other wrapped tools are mostly just fine to operate on .pyi stubs too. Supporting this would be a new feature:
is_pyi: bool = False
argument to the shed()
function.pyi
to the known extensions in _should_format()
, and define writer
as a partial in this case , to pass is_pyi
is_pyi
, pass the corresponding argument to black.Mode()
and don't refactor even if passed refactor=True
pyi
to the types_or
list in our example pre-commit configClosed by #61 🎉
autoflake.is_python_file
doesn't care about.pyi
as a file ending, but I don't see why that's the case. Running Black or isort manually they both reformat.pyi
, but shed uses autoflake's check and totally ignores them. I'm not sure if autoflake should fix it upstream, and/or if shed should reimplementis_python_file
itself (or take it from isort/black/etc if they have one).