Inconsistent Formatting (with Interface)
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず、提示された Java 入力を Prettier-Java 0.5.1 と示されている printWidth 設定で再現し、クラス、インターフェース、enum の宣言のフォーマットを比較します。意図されている改行の動作またはオプションの適用範囲を判断し、インターフェース宣言について合意した結果を示すテストカバレッジを追加します。
索引モデルが issue の本文から書いたものです。
説明
Prettier-Java 0.5.1
I'm not sure if this is the intended behavior of Prettier; Prettier adds a new line after class declarations but not after interface declarations.
overrides:
- files: ["*.java"]
options:
printWidth: 120
Input:
public interface ProjectOrBuilder extends com.google.protobuf.MessageOrBuilder {
String getModelVersion();
com.google.protobuf.ByteString getModelVersionBytes();
String getGroupId();
com.google.protobuf.ByteString getGroupIdBytes();
String getArtifactId();
com.google.protobuf.ByteString getArtifactIdBytes();
String getVersion();
}
Output:
public interface ProjectOrBuilder extends com.google.protobuf.MessageOrBuilder {
String getModelVersion();
com.google.protobuf.ByteString getModelVersionBytes();
String getGroupId();
com.google.protobuf.ByteString getGroupIdBytes();
String getArtifactId();
com.google.protobuf.ByteString getArtifactIdBytes();
String getVersion();
}
Expected behavior:
public interface ProjectOrBuilder extends com.google.protobuf.MessageOrBuilder {
String getModelVersion();
com.google.protobuf.ByteString getModelVersionBytes();
String getGroupId();
com.google.protobuf.ByteString getGroupIdBytes();
String getArtifactId();
com.google.protobuf.ByteString getArtifactIdBytes();
String getVersion();
}
I feel like if classes have new lines after their declaration, then interfaces and enums should follow the same pattern as well. An option to choose if newlines are added would be appreciated as well.
I'm not sure if this is a bug or an intended feature, however, I'm creating this issue to discuss this inconsistency in prettier.
- 主要言語
- Java
- スター
- 1.2k
- フォーク
- 123
- 平均マージ
- 2日 10時間
- マージ済み PR(30日)
- 35
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
jhipster/prettier-java のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
jhipster/prettier-java#1113 ·
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 56/100
jhipster/prettier-java#1114 ·
メンテナーはふだん 2 日以内に返信
-
Text block containing a comment-like line with " or \ fails with "Comment was not printed"対応中かも @sean0407 が 1 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 66/100
jhipster/prettier-java#1112 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
jhipster/prettier-java#1031 ·
メンテナーはふだん 2 日以内に返信
-
Adds needlessly parentheses対応中かも @braxtonzhangio が 74 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 67/100
jhipster/prettier-java#1001 ·
メンテナーはふだん 2 日以内に返信
jhipster/prettier-java の issue をすべて見る
似ている issue
-
human-required sync-failed
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Azure/osdu-spi-file#63 ·
メンテナーはふだん 1 日以内に返信
-
frontend quick win
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
CodeForPhilly/benefit-decision-toolkit#571 ·
メンテナーはふだん 1 日以内に返信
-
approved
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
checkstyle/checkstyle#22129 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Add Hardcharger JDBC driver対応中かも @prmoore77 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信