Formatting ratchet
See original GitHub issuespotless {
ratchetFrom 'origin/master'
...
In this mode, spotless will filter the target further, to only apply to files which have changed since origin/master
. This is similar to https://github.com/diffplug/spotless/issues/178 (only apply to staged files), but imo strictly better.
Lots of people are reticent to the “mega-format-commit” that happens when you go from human-formatted to machine-formatted, and this would solve this issue. It also helps to keep copyright headers up-to-date (ours aren’t). Best of all, it doesn’t rely on you to run the formatter before you commit. If you commit without formatting, Spotless will still remind you in the PR, ensuring that there’s no need for humans to argue about formatting.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Ratchets in software development @ Things Of Interest - QNTM
Formatting rules are particularly prone to this, with the original goal (make the code more readable to other developers) often completely lost ...
Read more >Ratchet wrench reversible 22mm FORMAT
Open-ended spanner with ring ratchet, reversible. Design: Precisely toothed ratchet mechanism with 72 teeth and a return angle of 5°. Jaw positioned at...
Read more >Ratchet with 1/4 "rotating handle, 60 teeth 185mm FORMAT
Ratchet with interchangeable driver and 1/4 '' rotating handle Design: DIN 3122 D 6.3 - ISO 3315, chrome vanadium steel, chrome plated, with...
Read more >Category:Formatting templates | Ratchet & Clank Wiki - Fandom
Category:Formatting templates contains templates used for the standardization and proper use of formatting on the Ratchet & Clank Wiki.
Read more >docs/megolm.md · master · matrix-org / Olm · GitLab
Implementation of the olm and megolm cryptographic ratchets. ... the session data is formatted as described in Session-sharing format.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the explanation! That’s clever naming and I think it does do what I would expect.
Fair enough 😃.
By source and target, I mean the source and target branches of a merge…i.e., the source would be a feature branch or a working copy and the target is typically the default branch (usually master). In other words, the files I would want to run Spotless on in this more general case could be gotten with the following command:
This is what I’ve been trying to use in the absence of the feature this ticket is about.
The feature I’m describing would be more versatile, but, after thinking about it some more, I don’t really think what I want to do is Spotless’s job. I think there is a way one could use git with Spotless to make this happen (once I can get
-PspotlessFiles
to work properly) and that honestly seems more appropriate, though I’m not sure I can articulate why my mind changed. I could still probably be convinced backReleased in
maven 2.0.0
, and much-improved inplugin-gradle 4.5.0
.