sqlalchemyorg / zimports

Python import rewriter
MIT License
75 stars 6 forks source link

Add support for additional configuration files #10

Open bhrutledge opened 4 years ago

bhrutledge commented 4 years ago

This is a TODO in the README, but I thought an explicit issue might be helpful. From the Flake8 docs, this could be "in your project in one of setup.cfg, tox.ini, or .flake8" (there's an open issue for pyproject.toml).

Maybe the flake8.options.config.ConfigFileFinder would be useful?

sigmavirus24 commented 4 years ago

Maybe the flake8.options.config.ConfigFileFinder would be useful?

That would require a dependency on Flake8 and that's not a public API that can be depended upon.

From the Flake8 docs, this could be "in your project in one of setup.cfg, tox.ini, or .flake8" (there's an open issue for pyproject.toml).

The reason pyproject.toml support hasn't been added is because having all those options in Flake8 is a nightmare. The Flake8 maintainers have been very clear about how much they hate having to support all those locations (I'm only one of them).

I've been very vocal about this with other projects (black, flake8-import-order, etc.) and how they should stick to looking for and parsing a single file and only that file.

zzzeek commented 4 years ago

zimports is dependent on flake8 now via pyflakes and flake8-import-order. but I agree getting into the use of private API will lead to breakage later. zimports already does all the things I need so it's not "actively" maintained, from my POV it's done :) so I'd rather not build things in that are going to just break one day.

sigmavirus24 commented 4 years ago

It's also worth pointing out that flake8-import-order is considered "complete" as well. So it's stable enough to import from.