3 ms·
We use isort[0] for this. It even has a "black" compatible profile that line spits along black's defaults. Additionally we use autoflake[1] to remove unused im
by evilsnoopi3 5y ago
We use isort[0] for this. It even has a "black" compatible profile that line spits along black's defaults. Additionally we use autoflake[1] to remove unused import statements in place.
[0](https://github.com/PyCQA/isort https://github.com/PyCQA/isort)
[1](https://github.com/PyCQA/autoflake https://github.com/PyCQA/autoflake)
- bwhmather 5y agoisort only sorts imports. ssort will sort all other statements within a module so that they go after any other statements they depend on. The two are complementary and I usually run both.
- rufugee 5y agoThanks for your work on this. Coming back to python from golang, I really missed the auto-formatting. black plus something like ssort seems to bring the same to python. I've had really good results with black so far and look forward to trying ssort.