-
Notifications
You must be signed in to change notification settings - Fork 767
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
Switch to spotless and format code #1196
Conversation
I might pause on merging this for a moment to evaluate |
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.
It’s far from perfect, but I also don’t want to care about whitespace.
@JakeWharton any feels?
* friendly than using SimpleDateFormat so highly suitable if you (un)serialize lots of date | ||
* objects. | ||
* | ||
* Supported parse format: [yyyy-MM-dd|yyyyMMdd][T(hh:mm[:ss[.sss]]|hhmm[ss[.sss]])]?[Z|[+-]hh[:]mm]] | ||
* <p>Supported parse format: | ||
* [yyyy-MM-dd|yyyyMMdd][T(hh:mm[:ss[.sss]]|hhmm[ss[.sss]])]?[Z|[+-]hh[:]mm]] |
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.
this one’s weird
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.
jshell> " * Supported parse format: [yyyy-MM-dd|yyyyMMdd][T(hh:mm[:ss[.sss]]|hhmm[ss[.sss]])]?[Z|[+-]hh[:]mm]]".length()
$1 ==> 101
public void fromJson() throws IOException { | ||
Moshi moshi = | ||
new Moshi.Builder() | ||
.add( |
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.
ew
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.
you get used to it
https://github.com/google/google-java-format/wiki/The-Rectangle-Rule
qualifiers = prop.annotations.mapTo(mutableSetOf()) { it.className } | ||
) | ||
} | ||
.asSequence() |
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.
still should be +4 on wrapped lines, right?
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.
Ktlint doesn't support continuation indent anymore, and the compose and kotlin people sold me recently on it being a "you get used to it" thing. The kotlin plugin is iffy on its support of it too
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.
Yep, you won't notice in a week.
} | ||
}).add(new UppercaseAdapterFactory()).build(); | ||
@Test | ||
public void toAndFromWithIntermediateWithQualifier() throws Exception { |
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 think this is strictly worse
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.
Also please don’t address my feedback above; I’m just ranting at bad choices made by the formatter |
. Switched over Retrofit a while ago and I don't care. Same for using ktlint on a bunch of projects. Whevs. |
SGTM. Thanks Zach! |
After merging, I can make a second PR setting up the format commit as an ignored revision to better protect history
Note that I haven't enabled licenses yet because there seems to be a bug in Spotless where it always overwrites the copyright year even if we had one set. diffplug/spotless#677