diffplug / diffplug/spotless

Spotless maven plugin sometimes doesn't detect wrong java Eclipse formatting

Open
#2,066 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
5.6k
Forks
559
Avg merge
1d 13h
Merged PRs (30d)
34

Description

Hi,

We use maven spotless plugin for java formatting in Eclipse format. In some cases it seems` spotless:check` doesn't shows errors on wrong formatting and `spotless:apply` doesn't apply changes.

Spotless maven plugin version: 2.43.0.
Maven version: 3.8.4
OS: Windows 10 Enterprise, 22H2
Spotless configuration:
```

com.diffplug.spotless
spotless-maven-plugin
${com.diffplug.spotless.plugin.version}




java,javax,org,com



```

Simplified java class when formatting is not applied (here are doubled empty lines that are not allowed):
```
package com.myproject;

import static org.mockito.Mockito.when;

class SpotlessTest {

void test() {

when(null);



}
}
```

It seems that issue is somehow related to `when`, because on code below formatting is applied:

```
package com.myproject;

import static org.mockito.Mockito.when;

class SpotlessTest {

void test() {

String a = "a";
when(null);



}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.