shfmt - support simplifying (`-s`) and minifying flags (`-mn`)
- Lingua principale
- Java
- Stelle
- 5.6k
- Fork
- 559
- Merge medio
- 1g 14h
- PR unite (30g)
- 43
Descrizione
`shfmt` supports [simplifying and/or minifying shell scripts](https://github.com/mvdan/sh/blob/master/cmd/shfmt/shfmt.1.scd#generic-flags). However, there is no support provided via `.editorconfig` for the flags. So we'll need some additional configuration in the shfmt Gradle DSL to enable these.
My thoughts are something akin to one of the following:
Option 1
```gradle
// Provides future extensible flexibility and follows the lead set by the `ktfmt` configuration
spotless {
shell {
shfmt().configure {
it.minify = true
it.simplify = true
}
}
}
```
Option 2
```gradle
// If any other options become available in the future, this seems to be less extensible, however, it is very readable
spotless {
shell {
shfmt()
.minify()
.simplify()
}
}
```
Note that minifying the code implies simplifying the code. So both flags can probably be true, but both flags aren't required to simplify and minify.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Parti dal punto di ingresso esistente della DSL Gradle di shfmt e analizza come vengono esposte altrove le opzioni del formatter, in particolare il pattern di configurazione di ktfmt menzionato nell’issue. Decidi tra proprietà configurabili e metodi fluent, quindi verifica che simplify e minify possano essere abilitati indipendentemente, mentre minify implica simplify.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- shell
- Ambito
- tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100