Case sensitive Java type annotations
まだ誰も着手していません。
評価
調査の方向性
まず、Maven 3.8 上で Spotless 2.38.0 を使って Java スニペットのフォーマットを再現し、次にフォーマッターが使用しているハードコードされた型アノテーションの照合を追跡します。Checker Framework @min と Jakarta Validation @Min のように大文字と小文字だけが異なるアノテーションが同じアノテーションとして扱われず、提示された例が一貫してフォーマットされれば完了です。
索引モデルが issue の本文から書いたものです。
説明
We are running Spotless 2.38.0 with Maven 3.8 to format Java and its annotations. Since currently hardcoded list of type annotations doesn't have fully qualified names I think annotations should be matched by case sensitive check.
Case in point, @min annotation from Checker Framework and @Min(X) annotation from Jakarta Validation are two different annotations.
Consider such code:
@NotNull
@Min(60)
@Max(86400)
public long getExpiration() {
return super.getExpiration();
}
Current behaviour results in @Min annotation moved inline with @NotNull and @Max left alone. What's more interesting (and could be related), is that @NotNull and @Min is never moved inline with public long even if I completely remove @Max.
@NotNull @Min(60)
@Max(86400)
public long getExpiration() {
return super.getExpiration();
}
Of source, checking by fully qualified names would be even better solution, but I think case sensitivity would solve current issue in a more trivial way.
- 主要言語
- Java
- スター
- 5.7k
- フォーク
- 560
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 40
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
diffplug/spotless のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 66/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
diffplug/spotless の issue をすべて見る
似ている issue
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
inu-appcenter/memorIN-backend#288 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
frontend maui-pilot pilot-ask question
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
area/plugin
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
kestra-io/plugin-kestra#190 ·