You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by "makinzm (via GitHub)" <gi...@apache.org> on 2025/12/07 23:37:06 UTC

[I] Enable import organization in rustfmt [iggy]

makinzm opened a new issue, #2453:
URL: https://github.com/apache/iggy/issues/2453

   ## Problem
   
   Currently, `cargo fmt` doesn't organize imports in a consistent manner. The import statements in our Rust codebase are not grouped or sorted in a standardized way, which makes code harder to read and review.
   
   ## Current State
   
   - Import statements are not grouped by their origin (std, external crates, local crates)
   - No consistent ordering within import groups
   - Manual import organization is required, leading to inconsistency
   
   ## Desired Outcome
   
   Implement automatic import organization with the following structure:
   1. **Standard library imports** (`std::*`, `core::*`)
   2. **External crate imports** (from dependencies)
   3. **Local crate imports** (from our workspace)
   
   Each group should be alphabetically sorted and separated by blank lines.
   
   ## Technical Requirements
   
   - Enable `imports_granularity = "Crate"` in rustfmt configuration
   - Enable `group_imports = "StdExternalCrate"` in rustfmt configuration
   - These features require nightly rustfmt, so CI/CD pipeline needs to be updated
   - Pre-commit hooks should also use nightly rustfmt for consistency
   
   ## Acceptance Criteria
   
   - [ ] rustfmt.toml is configured with import organization settings
   - [ ] GitHub Actions use nightly rustfmt for formatting checks
   - [ ] Pre-commit hooks use nightly rustfmt
   - [ ] All existing code is reformatted with consistent import organization
   - [ ] CI passes with new formatting requirements
   
   ## Benefits
   
   - Improved code readability
   - Consistent import organization across the codebase
   - Reduced cognitive load when reviewing code
   - Automatic enforcement of import standards
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Enable import organization in rustfmt [iggy]

Posted by "hubcio (via GitHub)" <gi...@apache.org>.
hubcio closed issue #2453: Enable import organization in rustfmt
URL: https://github.com/apache/iggy/issues/2453


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Enable import organization in rustfmt [iggy]

Posted by "hubcio (via GitHub)" <gi...@apache.org>.
hubcio commented on issue #2453:
URL: https://github.com/apache/iggy/issues/2453#issuecomment-3698488492

   we want to have it once it's in stable rustfmt


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org