spotlessApply --staged
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- git, java
- Ambito
- build-system, tooling
Direzione di ricerca
Inizia leggendo lo script dell'hook per i file staged collegato dall'issue #178 ed esamina l'integrazione git esistente di Spotless. Rivedi la discussione intorno a #603 e #600 prima di scegliere un approccio. Il lavoro è completo quando fornisce modalità staged per verificare o applicare la formattazione senza modificare il contenuto non staged del working tree.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Spotless applies itself to the files on disk. However, when git makes a commit, it does not use the files on disk, it uses the staging area. If you do this:
change foo.txt
spotlessApply
git add foo.txt
git commit -m "blah"
Then your commit will definitely pass a spotlessCheck. But if you do this, it might not:
change foo.txt
git add foo.txt
spotlessApply (changes foo on disk, but not the staged/index foo)
git commit -m "blah" (you committed the dirty foo, not the clean foo)
aside: this three-files-per-file model, with an independent index, is confusing to beginners, and imo of limited utility even to experts, which is why DiffPlug doesn't have a staging area.
@lowwor made an excellent git hook script which uses the stash to run spotlessCheck on staged files.
With our new git integration, it would now be relatively easy for Spotless to have a mode which operates on the staging area directly. This is especially useful for pre-commit hooks, which could either fail on badly formatted content spotlessCheck --staged, or silently fix the commit right before it is created spotlessApply --staged.
Due to merge conflicts that this is likely to generate, implementing this is blocked on #603 and #600. PR's welcome!
- Lingua principale
- Java
- Stelle
- 5.7k
- Fork
- 560
- Merge medio
- 1g 13h
- PR unite (30g)
- 43
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di diffplug/spotless
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 66/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
Tutte le issue di diffplug/spotless
Issue simili
-
certification
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
[BUG] ECR GetAuthorizationToken returns a proxyEndpoint for the default region, not the request's Apertabug ecr
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Needs: Triage Type: Feature request
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
AntennaPod/AntennaPod#8794 ·
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
github/copilot-sdk#2760 ·