linkedin / linkedin/pygradle

Spotless now integrates with black, but it could be better

Open
#347 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
603
Forks
142
PR merge metrics
No merged PRs in 30d

Description

[Spotless](https://github.com/diffplug/spotless/tree/main/plugin-gradle) is a code formatting plugin. It's main value adds are:

- it lets you compose multiple formatters (e.g. black + a license header that slurps copyright info from git history)
- it fixes lots of common bugs in formatters ([idempotence](https://github.com/diffplug/spotless/blob/main/PADDEDCELL.md), misconfigured [encodings](https://github.com/diffplug/spotless/blob/main/PADDEDCELL.md), [fighting with git over line endings](https://github.com/diffplug/spotless/tree/main/plugin-gradle#line-endings-and-encodings-invisible-stuff))
- your format gets really fast thanks to incremental build, local and remote build cache, etc.
- you can [ratchet your formatting](https://github.com/diffplug/spotless/tree/main/plugin-gradle#ratchet) so there's never a "format the world" commit

We just shipped support for black, but we have a not-so-great user setup experience, in that we:

- just use the `black` that's on your path
- or you have to point us to the exact executable manually :(

Anyway, it would be great to improve this behavior, which we're tracking at https://github.com/diffplug/spotless/issues/674. One way we could do it is for spotless to apply pygradle, or pygradle could apply spotless. Not sure which is better... Apologies if this is off-topic, feel free to close.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the current black integration in the Spotless Gradle plugin and the related Spotless issue 674. Compare the two proposed directions—pygradle applying Spotless or Spotless applying pygradle—and determine the user setup that should replace relying on black on PATH or requiring an exact executable path.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, python
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.