diffplug / diffplug/spotless

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

オープン
#2,032 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Java
スター
5.7k
フォーク
561
平均マージ
1日 14時間
マージ済み PR(30日)
43

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

既存の shfmt Gradle DSL エントリポイントから始め、他の場所で formatter オプションがどのように公開されているかを調査します。特に、issue で言及されている ktfmt の設定パターンを確認してください。設定可能な Properties と fluent メソッドのどちらを採用するかを決め、そのうえで simplify と minify を独立して有効化でき、minify が simplify を意味することを検証してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
shell
領域
tooling
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。