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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to