Shebang results in two newlines at the end of file
まだ誰も着手していません。
評価
調査の方向性
@prettier/plugin-php v0.22.4 を使用して、リンク先の Playground の出力を再現し、shebang の例と、shebang のない同等のファイルを比較します。shebang を処理する formatter のパスを追跡し、フォーマットされたファイルの末尾が 2 つではなく 1 つの末尾改行で終わることを確認します。
索引モデルが issue の本文から書いたものです。
説明
@prettier/plugin-php v0.22.4
Playground link
Input:
#! /usr/bin/env php
<?php
$status = 0; exit($status);
Output:
#! /usr/bin/env php
<?php
$status = 0;
exit($status);
The Markdown render is not showing the newlines, so check the Playground.
Gut instinct is that it might be triggering the code path for inline code, but not sure, so letting you tag it if it is (not that I can even add labels). I'm mulling over how minor or petty this is, but I think the inconsistency between files with & without a shebang and how no other formatter for Prettier has a double newline at the end of a file is enough of a reason.
Feel free to shoot this down if you have a reason to do so. If for nothing else, someone might stumble across this issue and not feel like they are going crazy as to why they get double newlines at the end of the file. If you want someone to blame, it's Laravel's artisan stub they put into your repo that got me going.
- 主要言語
- PHP
- スター
- 1.9k
- フォーク
- 139
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
prettier/plugin-php のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
prettier/plugin-php#2416 · コメント 2 件 · リアクション 6 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
prettier/plugin-php#2498 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
prettier/plugin-php#2495 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
prettier/plugin-php#2494 · コメント 1 件 ·
-
strange format issue オープン
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
prettier/plugin-php#2490 ·
prettier/plugin-php の issue をすべて見る
似ている issue
-
jira-created
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
nunomaduro/phpinsights#745 ·
-
status/awaiting_triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
WordPress/plugin-check#1486 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
az-digital/az_quickstart#6019 ·