diffplug / diffplug/spotless

shfmt - support simplifying (`-s`) and minifying flags (`-mn`)

Offen
#2,032 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Java
Sterne
5.6k
Forks
559
Ø Merge
1 T. 14 Std.
Gemergte PRs (30 T.)
43

Beschreibung

`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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne am bestehenden shfmt-Gradle-DSL-Einstiegspunkt und untersuche, wie Formatter-Optionen an anderer Stelle bereitgestellt werden, insbesondere das im Issue erwähnte ktfmt-Konfigurationsmuster. Entscheide zwischen konfigurierbaren Properties und Fluent-Methoden und verifiziere anschließend, dass simplify und minify unabhängig voneinander aktiviert werden können, wobei minify simplify voraussetzt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
shell
Bereich
tooling
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.