Skip to content

Sorted explicit import#4888

Open
vidit-od wants to merge 2 commits intohaskell:masterfrom
vidit-od:Sorted-Explicit-Import
Open

Sorted explicit import#4888
vidit-od wants to merge 2 commits intohaskell:masterfrom
vidit-od:Sorted-Explicit-Import

Conversation

@vidit-od
Copy link
Copy Markdown
Collaborator

@vidit-od vidit-od commented Apr 7, 2026

Closes #4875

We follow the following procedure for sorting the imports and maintaining import format.

  1. scan the old import list. If it is a single line list we preserve the behaviour after sorting.

explicite-singleline

  1. if the old import list is multilined. we force a one-line one import item format.
    explicite-multiline

Note : a few of the regression tests have been changed to match this behavior. a few more may need to change. In case the above 2 formats are finalized we can change more if needed.

vidit-od added 2 commits April 7, 2026 16:46
Scan the old import list to find if it was single lined or multilined. we have a fix format for both of the cases. If old was single lined, keep the new sorted import list single lined. if it was multi-lined then we force a one line is one import item format. Both of these formats have items in sorted order.
@vidit-od vidit-od requested a review from fendor April 7, 2026 11:35
@vidit-od vidit-od requested a review from santiweight as a code owner April 7, 2026 11:35
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 this pull request may close these issues.

[explicit-imports-plugin] sort imported symbols

1 participant