Skip to content

[Recommendation] Remove experimental-sort-imports #387

@gaffney

Description

@gaffney

First of all, thank you for this amazing library. I was in mental anguish adding it today because I kept imagining how much time I could have saved over the years had I known about this earlier. Truly a game changer for me.

That said, I was surprised to see an "experimental" sorting option because that felt like an unnecessary feature, and this library is already doing a lot. isort is a well-established and battle tested library for sorting imports. It works really well, and I have had maybe 1 issue with it in 6+ years which the author patched promptly.

I recommend focusing on your unique value-add and letting other libraries handle the rest.

This is how I combine the two in my Makefile to get the best of both worlds:

# ...

pyflyby: ## Automatically fix missing imports using pyflyby
	PYFLYBY_PATH=$(PWD)/app/.pyflyby pipenv run tidy-imports --add-missing $$( { git diff --diff-filter=ACMT --name-only; git diff --cached --name-only --diff-filter=ACMT; } | grep '\.py$$' || true) --canonicalize -r

prepare: pyflyby isort black flake8 ## Run pyflyby, isort, black, and flake8 on code

Just my two cents; I will not be offended if you disagree and close this :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions