palantir-java-format
palantir-java-format copied to clipboard
Formatter on/off config disregarded by Palentir IntelliJ's plugin
IntelliJ's version: 2025.1.1.1 (Ultimate Edition) Plugin version: 2.67.0
Issue
Given formatter off/on comment is enabled in IntelliJ's configuration (Settings>Editor > Code Style > Formatter tab):
With a code as follow (Spring security config is a good example where we don't want any auto-formatting):
// @formatter:off
return http.csrf(CsrfConfigurer::disable)
.authorizeHttpRequests(authz -> authz.requestMatchers(
"/actuator/**",
"/error")
.permitAll()
.anyRequest().authenticated())
.sessionManagement(sm -> sm.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
.build();
// @formatter:on
Expected behaviour
Code between formatter off/on comments should not be formatted by Palentir formatter.
Actual behaviour
Code is formatted by Palentir formatter. But it is properly ignored by IntelliJ's default formatter.