okhttp icon indicating copy to clipboard operation
okhttp copied to clipboard

spotlessApply stopped working

Open yschimke opened this issue 5 years ago • 2 comments

Not sure when or why, but spotlessApply isn't working. We have one of the most awkward build setups with android tests and doubly mapped test source paths, so possibly at this point.

Overall, from a clean checkout we should be generating clean code without fighting the tools by default or with a single command. Currently Intellij and AS defaults cause a lot of differences. Maybe .editorconfig is the solution?

yschimke avatar Nov 19 '20 21:11 yschimke

@swankjesse is there a gold standard for project setup here? Spotless or otherwise.

yschimke avatar Nov 21 '20 07:11 yschimke

Just what's in these projects’ official documentation.

swankjesse avatar Nov 21 '20 12:11 swankjesse

Any interest in pursuing the work in https://github.com/square/okhttp/pull/7126 ? OkHttp may be interested in activated cleanthat (both as a Github App to clean PRs, and as a Spotless plugin) to automatically apply some linting rules.

blacelle avatar Mar 06 '23 07:03 blacelle

Yes, but only if it works well, low friction and isn't annoying to humans (IDE matches CI). :)

Last time we reverted IIRC because of angst it caused

yschimke avatar Mar 06 '23 07:03 yschimke

As @Goooler previously, I'm willing to give a hand. I understand we agreed a PR should be opened by an okhttp maintainer as many files may be reformatted in the initial PR. (We may also target an initial PR not to impact many files, and add rules through time).

My personal interest is to activate cleanthat for automatic linting (on top of Spotless, or through a Github app for PR cleaning) (java-code only for now). But I'm fine giving a hand even if you need only formatting.

IDE would match CI by either relying on a standard formatters (Eclipse, Google java Format, etc), and/or relying on some IDE-plugins (e.g. there is Intellij|VisualStudio plugins to apply Spotless).

I suggest you open a PR, starting from https://github.com/square/okhttp/commit/dfef48dd3654854bf6b24ed00fccb0142e81722a as suggested here (https://github.com/square/okhttp/pull/7126#issuecomment-1053949844) and we discuss what's not satisfactory?

blacelle avatar Mar 06 '23 08:03 blacelle

cc @swankjesse you ok with this plan? Or still want to avoid the mass reformat?

yschimke avatar Mar 06 '23 08:03 yschimke

When we've looked at automating this, we haven't gotten agreement. Closing.

yschimke avatar May 21 '23 08:05 yschimke