prettier / prettier/plugin-php
Non-associative arrays formatting is not consistent with associative arrays
オープン
まだ誰も着手していません。
- 主要言語
- PHP
- スター
- 1.9k
- フォーク
- 139
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Prettier 2.6.2
PHP Plugin 0.18.5
Input:
class Test
{
protected $array1 = [
'published', 'title', 'description', 'position', 'nid'];
protected $array2 = [
0=>'published', 'title', 'description', 'position', 'nid'];
}
Output:
class Test
{
protected $array1 = ['published', 'title', 'description', 'position', 'nid'];
protected $array2 = [
0 => 'published',
'title',
'description',
'position',
'nid',
];
}
Expected behavior:
class Test
{
protected $array1 = [
'published',
'title',
'description',
'position',
'nid',
];
protected $array2 = [
0 => 'published',
'title',
'description',
'position',
'nid',
];
}
If we break any array (associative or not) into multiple lines it should format the array as multiple lines, as it does for associative arrays. Also, this comment states that the multi-line format should be preserved.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
issue に記載されている Prettier PHP plugin のバージョンで報告された入力を再現し、出力を期待されるフォーマットと比較します。まず、issue 1401 からリンクされているコメントを含め、plugin の配列フォーマット動作を追跡します。複数行の非連想配列が改行を保持し、示されている期待される出力と一致すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- php
- 領域
- tooling
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 38/100