-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Formatting follow-up #2540
Formatting follow-up #2540
Conversation
- Adds formatting commits to .git-blame-ignore-revs so that they don't distract during Git blame - Restores hard line breaks in Troubleshooting.md using `\` instead of trailing spaces - Changes formatting of some string literals and comments - Fixes accidental Javadoc and comment issues introduced by manual changes of formatting commit - Fixes license header in $Gson$Types.java erroneously being a Javadoc comment and being reformatted - Slightly changes `JsonReader` `getPath` and `getPreviousPath` documentation to help Javadoc detect first sentence as summary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting in all this effort! Just some small remarks.
assertThat(json).isEqualTo("{\n" + " \"a\": [\n" + " 1,\n" + " 2\n" + " ]\n" + "}"); | ||
assertThat(json) | ||
.isEqualTo( | ||
// spotless:off |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should be necessary. If you put an empty //
comment at the end of any line then google-java-format will not try to join them:
assertThat(json).isEqualTo(
"{\n" //
+ ...);
Though I don't really know whether the Spotless plugin applies exactly the same logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you put an empty
//
comment at the end of any line then google-java-format will not try to join them
Yes that works, and I guess here it is ok because there are always multiple lines with //
, but a single trailing //
on its own looks to me rather like someone forgot to finish a comment.
Though I don't really know whether the Spotless plugin applies exactly the same logic.
I think it should. If I understand it correctly it just delegates the formatting to google-java-format (and optionally applies additional formatting steps).
gson/src/test/java/com/google/gson/functional/LeniencyTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again!
* Formatting follow-up - Adds formatting commits to .git-blame-ignore-revs so that they don't distract during Git blame - Restores hard line breaks in Troubleshooting.md using `\` instead of trailing spaces - Changes formatting of some string literals and comments - Fixes accidental Javadoc and comment issues introduced by manual changes of formatting commit - Fixes license header in $Gson$Types.java erroneously being a Javadoc comment and being reformatted - Slightly changes `JsonReader` `getPath` and `getPreviousPath` documentation to help Javadoc detect first sentence as summary * Remove `spotless:off` markers * Add empty line before comment * Check format for .github YAML files
Purpose
Follow-up for #2531, #2536 and #2537
Description
.git-blame-ignore-revs
so that they don't distract during Git blame; see also the GitHub documentation\
instead of trailing spaces$Gson$Types.java
erroneously being a Javadoc comment and being reformattedJsonReader
getPath
andgetPreviousPath
documentation to help Javadoc detect first sentence as summaryChecklist
null
@since $next-version$
(
$next-version$
is a special placeholder which is automatically replaced during release)TestCase
)mvn clean verify javadoc:jar
passes without errors