Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A command-line flag to sort __all__ re-exports #1862

Closed
parafoxia opened this issue Dec 4, 2021 · 1 comment · Fixed by #1863
Closed

A command-line flag to sort __all__ re-exports #1862

parafoxia opened this issue Dec 4, 2021 · 1 comment · Fixed by #1863

Comments

@parafoxia
Copy link
Contributor

Generally speaking, imports in typed projects have a list (or tuple) of __all__ exports that should be made. #1358 introduces a way to do this using comments, but this can look quite messy and cluttered. For such a common use case, I would suggest a command-line flag that can automatically find and sort these __all__ exports.

Ideally this would look something like this:

isort . --sort-reexports

And in a config file (specifically pyproject.toml in this case):

[tool.isort]
sort_reexports = true

The name for the flag is taken from Mypy's "implicit re-exporting is disabled" message, but if there's anything more suitable obviously that should be used instead.

This should also support the notion described in #1815 when that's done.

@parafoxia
Copy link
Contributor Author

I do plan to attempt to contribute this myself btw.

timothycrosley added a commit that referenced this issue Dec 6, 2021
Add a command-line flag to sort __all__ re-exports (#1862)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant