Back to all reviewers

Alphabetical ordering requirement

spring-projects/spring-boot
Based on 6 comments
Other

Always maintain alphabetical ordering for lists of elements including dependencies, modules, configuration entries, and other similar collections. This convention improves code organization, makes it easier to locate items, prevents duplications, and ensures consistency across the codebase.

Code Style Other

Reviewer Prompt

Always maintain alphabetical ordering for lists of elements including dependencies, modules, configuration entries, and other similar collections. This convention improves code organization, makes it easier to locate items, prevents duplications, and ensures consistency across the codebase.

When adding new elements to existing lists, ensure they are placed in the correct alphabetical position:

dependencies {
  // Correct: alphabetically ordered
  dockerTestRuntimeOnly("com.ibm.db2:jcc")
  dockerTestRuntimeOnly("io.r2dbc:r2dbc-mssql")
  dockerTestRuntimeOnly("org.postgresql:postgresql")
  dockerTestRuntimeOnly("org.postgresql:r2dbc-postgresql")
  
  // Incorrect: not alphabetically ordered
  dockerTestRuntimeOnly("io.r2dbc:r2dbc-mssql")
  dockerTestRuntimeOnly("org.postgresql:postgresql")
  dockerTestRuntimeOnly("org.postgresql:r2dbc-postgresql")
  dockerTestRuntimeOnly("com.ibm.db2:jcc")  // Wrong position
}

This rule applies to all list-like structures including gradle dependencies, spring.factories entries, module definitions, and similar configuration files throughout the project.

6
Comments Analyzed
Other
Primary Language
Code Style
Category

Source Discussions