Zac-HD / shed

`shed` canonicalises Python code. Shed your legacy, stop bikeshedding, and move on. Black++
https://pypi.org/project/shed/
GNU Affero General Public License v3.0
342 stars 23 forks source link

Run isort before and after autoflake. #82

Closed DRMacIver closed 1 year ago

DRMacIver commented 1 year ago

Fixes #78, #75

The proposed solution in #78 was to swap the order of isort and autoflake, but this doesn't currently work because you run into https://github.com/PyCQA/autoflake/issues/106 (which I think is the reason why it's currently the way around that it is). Running isort, then autoflake, then isort again, seems to be sufficient to solve this problem.

I looked into a more sophisticated solution which treats this as a running multiple passes to their collective fixed point, and it worked fine but didn't seem to have any real benefit to it and was a bit messier than what was currently here, so this just takes the simplest approach that will work.