Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Java files from default Maven Groovy formatting #1051

Merged
merged 4 commits into from
Jan 3, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion plugin-maven/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (

## [Unreleased]
### Fixed
* Remove Java files from default Maven Groovy formatting ([#1051](https://github.com/diffplug/spotless/pull/1051)).
* **BREAKING** Remove Java files from default Maven Groovy formatting ([#1051](https://github.com/diffplug/spotless/pull/1051)).
* This breaking change affects you only if you are using the `<groovy>` language block **and** you have `.java` files located within `src/main/groovy` or `src/test/groovy`.
* Before `3.0.0`, the default target of groovy was
* `src/main/groovy/**/*.groovy`
* `src/test/groovy/**/*.groovy`
* `src/main/groovy/**/*.java`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small correction. I removed the following file masks:

  • src/main/java/**/*.java
  • src/test/java/**/*.java

The Groovy formatter tried to format Java sources that live under the Java sources root. I think it is weird and perhaps even undesirable to format such source files with a Groovy formatter. This PR changes the default behavior, but it is more like a fix in my opinion.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh man that is super weird! It's so weird my brain couldn't read it the first time, thanks for pointing that out! I always agreed that it was a fix, but now I also agree that it is not a "breaking fix".

* `src/test/groovy/**/*.java`
* This release just removes the `.java` includes.

## [2.18.0] - 2021-12-23
### Added
Expand Down