diffplug / diffplug/spotless

Allow spotless greclipse.properties to be selected via configuration

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

説明

The default formatting configuration of `greclipse` isn't very standard or desirable. However, spotless configures [`greclipse.properties`](https://github.com/diffplug/spotless/blob/main/testlib/src/main/resources/groovy/greclipse/format/greclipse.properties) in a much more standard way.

For example, compare the default formatting of `googleJavaFormat` to `greclipse`. They're very different.

If you Google `site:github.com "greclipse.properties"`, you will find that many projects simply copied this file as defined by spotless.

Instead of having to copy `greclipse.properties` into every project, it'd be sweet if we could just select this formatting configuration by spotless via configuration, for example:
```xml

spotless

```

EDIT:
Unfortunately, I spoke too soon. I didn't realize spotless's [`greclipse.properties`](https://github.com/diffplug/spotless/blob/main/testlib/src/main/resources/groovy/greclipse/format/greclipse.properties) sets the following (I assume for testing):
```properties
groovy.formatter.braces.start=next
groovy.formatter.braces.end=same
```

These settings aren't very typical. I propose the following settings to stay consistent with [`googleJavaFormat`](https://google.github.io/styleguide/javaguide.html) as well as with examples on the [Groovy style guide](https://groovy-lang.org/style-guide.html):
```properties
groovy.formatter.braces.end=next
groovy.formatter.braces.start=same
groovy.formatter.longListLength=100
groovy.formatter.multiline.indentation=4
groovy.formatter.remove.unnecessary.semicolons=true
org.eclipse.jdt.core.formatter.indent_empty_lines=false
org.eclipse.jdt.core.formatter.tabulation.char=space
org.eclipse.jdt.core.formatter.tabulation.size=2
```

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

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

調査の方向性

まず、testlib/src/main/resources/groovy/greclipse/format/greclipse.properties と greclipse formatter の設定エントリーポイントを調べます。参照されている Spotless のプロパティと、issue で改訂された設定を比較し、名前付き設定を選択する方法を明らかにします。プロジェクトが properties ファイルをコピーせずに設定を選択でき、結果のフォーマットがドキュメント化された設定と一致すれば完了です。

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

評価

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

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

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