adityamparikh opened a new pull request, #266:
URL: https://github.com/apache/solr-mcp/pull/266

   ## What
   
   Formats the whole codebase so that a method chain too long for one line has 
each call after the first on its own line. This happens before 1.0, so the 
release ships one consistent style.
   
   Two keys are added to `config/spotless/eclipse-java-formatter.properties`:
   
   - `alignment_for_selector_in_method_invocation=80` (`M_NEXT_PER_LINE_SPLIT`, 
not forced): once a chain no longer fits, every call after the first goes on 
its own line.
   - `join_wrapped_lines=false`: keeps line breaks the author added, such as a 
break before `.stream()`, instead of packing them back onto as few lines as 
fit. Long lines are still wrapped.
   
   Everything else in the diff is `./gradlew spotlessApply` over 25 Java files, 
7 in `src/main` and 18 in `src/test`. There are no code changes.
   
   ## Why
   
   The stock setting packs as many calls as fit onto each line, so a pipeline 
reads as one run of calls:
   
   ```java
   return listCollections().stream().filter(c -> c != null && 
c.toLowerCase(Locale.ROOT).startsWith(prefix))
           .sorted().limit(MAX_COMPLETION_RESULTS).toList();
   ```
   
   With this change it reads as its steps:
   
   ```java
   return listCollections().stream()
           .filter(c -> c != null && 
c.toLowerCase(Locale.ROOT).startsWith(prefix))
           .sorted()
           .limit(MAX_COMPLETION_RESULTS)
           .toList();
   ```
   
   Chains that fit on one line, such as `builder.build()`, are unchanged. A 
single call such as `List.of(...)` or `String.join(...)` is never split before 
the dot. That ruled out `48` (`M_ONE_PER_LINE_SPLIT`), which produces `List` / 
`.of(...)` and reformats 38 files instead of 25. The forced variants (`81`, 
`49`) split every chain, including short ones.
   
   ## Verification
   
   - `./gradlew spotlessApply` run a second time changes nothing.
   - `./gradlew build` passes.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to