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

formatAnnotations() removes line breaks between type annotations and types #1275

Merged
merged 26 commits into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1c60826
`typeAnnotations()` removes line breaks between type annotations and …
mernst Aug 12, 2022
105eb87
Add changelog entry
mernst Aug 12, 2022
6d76fc9
Changelog in `plugin-gradle`, too
mernst Aug 12, 2022
0c5d1b6
Don't use Java 11 APIs
mernst Aug 13, 2022
42edcb1
Add documentation in `README.md`
mernst Aug 25, 2022
712d77a
Merge ../spotless into typeAnnotations
mernst Aug 25, 2022
4ad48a9
Fix indentation
mernst Aug 25, 2022
e886d24
The Checker Framework supports most known type annotations.
mernst Aug 25, 2022
8666f98
Add line to table
mernst Aug 25, 2022
68e4217
Tweak comment
mernst Aug 25, 2022
e69ab4b
Add Maven support
mernst Aug 25, 2022
61da1b2
Fix test name
mernst Aug 25, 2022
9553e60
Define "type annotation"
mernst Aug 25, 2022
d7cd9fd
No reordering
mernst Aug 25, 2022
d8f047e
Whitespace
mernst Aug 25, 2022
437636b
List of type annotations is hard-coded
mernst Aug 25, 2022
45cb9e4
Merge ../spotless into typeAnnotations
mernst Aug 28, 2022
d8b8a86
Support `addTypeAnnotation()` and `removeTypeAnnotation()`
mernst Aug 28, 2022
48394fe
Merge branch 'typeAnnotations' of github.com:mernst/spotless into typ…
mernst Aug 28, 2022
263da38
Tweaks
mernst Aug 28, 2022
0404062
Tabify
mernst Aug 28, 2022
56b0ec9
Merge branch 'main' into typeAnnotations
nedtwigg Sep 14, 2022
ef219c0
Remove workarounds to #834 because they are no longer needed thanks t…
nedtwigg Sep 14, 2022
61d362b
Keep the step-specific sections specific to their section.
nedtwigg Sep 14, 2022
7a434ce
Fix TOC entry to match the new formatAnnotations name.
nedtwigg Sep 14, 2022
78cd2ef
Minor tweak to changelog.
nedtwigg Sep 14, 2022
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
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ This document is intended for Spotless developers.
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).

## [Unreleased]
### Added
* `formatAnnotations()` step to correct formatting of Java type annotations. It puts type annotations on the same line as the type that they qualify. Run it after a Java formatting step, such as `googleJavaFormat()`. ([#1275](https://github.com/diffplug/spotless/pull/1275))

## [2.29.0] - 2022-08-23
### Added
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ lib('java.ImportOrderStep') +'{{yes}} | {{yes}}
lib('java.PalantirJavaFormatStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
lib('java.RemoveUnusedImportsStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |',
extra('java.EclipseJdtFormatterStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |',
lib('java.FormatAnnotationsStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
lib('json.gson.GsonStep') +'{{yes}} | {{no}} | {{no}} | {{no}} |',
lib('json.JsonSimpleStep') +'{{yes}} | {{no}} | {{no}} | {{no}} |',
lib('kotlin.KtLintStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |',
Expand Down Expand Up @@ -104,6 +105,7 @@ extra('wtp.EclipseWtpFormatterStep') +'{{yes}} | {{yes}}
| [`java.PalantirJavaFormatStep`](lib/src/main/java/com/diffplug/spotless/java/PalantirJavaFormatStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
| [`java.RemoveUnusedImportsStep`](lib/src/main/java/com/diffplug/spotless/java/RemoveUnusedImportsStep.java) | :+1: | :+1: | :+1: | :white_large_square: |
| [`java.EclipseJdtFormatterStep`](lib-extra/src/main/java/com/diffplug/spotless/extra/java/EclipseJdtFormatterStep.java) | :+1: | :+1: | :+1: | :white_large_square: |
| [`java.FormatAnnotationsStep`](lib/src/main/java/com/diffplug/spotless/java/FormatAnnotationsStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
| [`json.gson.GsonStep`](lib/src/main/java/com/diffplug/spotless/json/gson/GsonStep.java) | :+1: | :white_large_square: | :white_large_square: | :white_large_square: |
| [`json.JsonSimpleStep`](lib/src/main/java/com/diffplug/spotless/json/JsonSimpleStep.java) | :+1: | :white_large_square: | :white_large_square: | :white_large_square: |
| [`kotlin.KtLintStep`](lib/src/main/java/com/diffplug/spotless/kotlin/KtLintStep.java) | :+1: | :+1: | :+1: | :white_large_square: |
Expand Down
1 change: 1 addition & 0 deletions gradle/spotless.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ spotless {
eclipse().configFile rootProject.file('gradle/spotless.eclipseformat.xml')
trimTrailingWhitespace()
removeUnusedImports()
// TODO: formatAnnotations()
custom 'noInternalDeps', noInternalDepsClosure
}
}
Expand Down
Loading