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

Fix re-export sorter #2065

Merged
merged 4 commits into from
Jan 20, 2023
Merged

Conversation

parafoxia
Copy link
Contributor

@parafoxia parafoxia commented Jan 2, 2023

PR changes

  1. Fixes a big where the line would be duplicated rather than sorted

  2. Allows for unbracketed tuples to be sorted

  3. Allows sets of re-exports to be sorted

  4. Allows literals to be sorted even if there are no spaces between the variable name and the literal

  5. Renames numerous variables tied to the re-exporter for clarity

Regarding point 4

Previously, isort would not be able to sort the following code:

my_list=[2, 3, 1]

Now, it sorts it like so:

my_list = [1, 2, 3]

Related issues

Closes #1887.
Closes #1971.
Closes #2037.

@codecov
Copy link

codecov bot commented Jan 2, 2023

Codecov Report

Merging #2065 (5116f90) into main (b20228c) will increase coverage by 0.48%.
The diff coverage is 94.44%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2065      +/-   ##
==========================================
+ Coverage   98.80%   99.28%   +0.48%     
==========================================
  Files          38       38              
  Lines        3084     3088       +4     
  Branches      745      746       +1     
==========================================
+ Hits         3047     3066      +19     
+ Misses         26       13      -13     
+ Partials       11        9       -2     

@parafoxia parafoxia marked this pull request as ready for review January 2, 2023 00:38
I'm not sure where the best place is for this, so I placed it around various options similar to it (at least as far as I can tell).
@kevalmorabia97
Copy link

Thanks for the fix. Looking forward to it!

@parafoxia
Copy link
Contributor Author

parafoxia commented Jan 15, 2023

@timothycrosley Sorry for the ping, can I request this be reviewed/merged? It would be good to have the working version of this feature available for the general userbase to use, especially for those that have asked about it.

@kevalmorabia97
Copy link

It would be great to have this merged!

@timothycrosley timothycrosley merged commit f31884b into PyCQA:main Jan 20, 2023
@parafoxia parafoxia deleted the task/fix-sort-reexports branch January 20, 2023 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants