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

Implement version-sort for imports in style_edition 2024 #6284

Merged
merged 4 commits into from
Sep 3, 2024

Commits on Sep 3, 2024

  1. implement version-sorting algorithm for rust identifiers

    The algorithm is described in the [style guide] and was introduced in
    `r-l/rust 115046`.
    
    [style guide]: https://doc.rust-lang.org/nightly/style-guide/#sorting
    ytmimi authored and calebcartwright committed Sep 3, 2024
    Configuration menu
    Copy the full SHA
    2b0ce7f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    456026d View commit details
    Browse the repository at this point in the history
  3. sort rustfmt imports

    The version-sort algorithm makes changes to the sort order of imports,
    and we're updating them here for the self tests.
    ytmimi authored and calebcartwright committed Sep 3, 2024
    Configuration menu
    Copy the full SHA
    de4e37f View commit details
    Browse the repository at this point in the history
  4. Add test cases for issue 4381

    This was one of the original issues filed against rustfmt that discussed
    using a natural sort order instead of a lexicographical order. At the
    time it was closed, but now that we're supporting version-sorting in
    `style_edition=2024` I thought it would be good to add a test case.
    ytmimi authored and calebcartwright committed Sep 3, 2024
    Configuration menu
    Copy the full SHA
    4192118 View commit details
    Browse the repository at this point in the history