Comments starting with /// should not be reformatted as // /
まだ誰も着手していません。
評価
調査の方向性
///usr/bin/env jbang "$0" "$@" ; exit $? ヘッダーについて報告されたフォーマットを google-java-format で再現し、出力を比較する。/// で始まるコメントに対するフォーマッターの動作を追跡する。shebang 形式の行が完全にそのまま残り、通常のコメントのフォーマットが維持されれば完了とする。
索引モデルが issue の本文から書いたものです。
説明
I'm toying (more "for fun") with https://openjdk.org/jeps/330 something in https://github.com/enola-dev/enola/issues/971:
I am using https://www.jbang.dev, but Im not sure if this issue specific to that tool or really could be considered more generically:
As per https://www.jbang.dev/documentation/guide/latest/faq.html, and (apparently) partly inspired by https://golangcookbook.com/chapters/running/shebang/ in Go, given that JEP 330 "shebang" headers are still a bit of a PITA (see also related #1214), I'm starting a Java file with ///usr/bin/env jbang "$0" "$@" ; exit $?
google-java-format reformats ///usr/bin/env jbang "$0" "$@" ; exit $? to /// usr/bin/env jbang "$0" "$@" ; exit $? (note the added space), which breaks the magic.
Unfortunately, as per https://github.com/google/google-java-format/wiki/FAQ#why-cant-i-use-magic-comments-to-disable-formatting-for-certain-sections-of-code, it does not seem to be easily possible to suppress formatting that first line.
The only choice seems to be not to use google-java-format for such "script" like Java files (shame), or not to use that header in them.
- 主要言語
- Java
- スター
- 6.2k
- フォーク
- 936
- 平均マージ
- 6分
- マージ済み PR(30日)
- 3
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
google/google-java-format のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
google/google-java-format#1094 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
google/google-java-format#1450 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
google/google-java-format#1439 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
google/google-java-format#1436 · コメント 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
google/google-java-format#1428 · コメント 3 件 ·
google/google-java-format の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
elastic/gradle-plugins#157 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
cryptomator/hub#497 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
johanhaleby/occurrent#1120 ·