Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Indentation fixing

オープン
#47 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
php
領域
tooling

調査の方向性

現在のインデンテーション fixer を見つけ、issue にある simpara と row の例を再現してください。その出力を、先頭の空白と fixer の順序を含めて、期待される XML と比較してください。両方の例が示されているとおりにフォーマットされ、空白が誤って正規化されなければ完了です。

索引モデルが issue の本文から書いたものです。

説明

The simpara in this example is misaligned. Perhaps a good follow up for indentation fixers (sniffers might should use warn/info instead error).

Current:

  <para>
   <example>
      <title>ImagickPixel <function>getColorCount</function></title>
      <programlisting role="php">
      <![CDATA[
<?php
    $imagick = new \Imagick();
    $imagick->newPseudoImage(640, 480, "magick:logo");
    $histogramElements = $imagick->getImageHistogram();
    $lastColor = array_pop($histogramElements);
    echo "Last pixel color count is: ".$lastColor->getColorCount();
?>
]]>
      </programlisting>
        <simpara>
The output for this will be similar to:
    </simpara>
    <screen role="php">
<![CDATA[
Last pixel color count is: 256244
]]>
    </screen>
    </example>
  </para>

Expected:

  <para>
   <example>
      <title>ImagickPixel <function>getColorCount</function></title>
      <programlisting role="php">
      <![CDATA[
<?php
    $imagick = new \Imagick();
    $imagick->newPseudoImage(640, 480, "magick:logo");
    $histogramElements = $imagick->getImageHistogram();
    $lastColor = array_pop($histogramElements);
    echo "Last pixel color count is: ".$lastColor->getColorCount();
?>
]]>
      </programlisting>
      <simpara>
          The output for this will be similar to:
       </simpara>
       <screen role="php">
<![CDATA[
Last pixel color count is: 256244
]]>
       </screen>
    </example>
  </para>
Edit

The current indentation fixer also doesn't yet work fully smooth. Leading whitespace is normalised as if it is wrong whitespace dupllication, although it should reformat the elements correctly

        <row>
         <entry><literal>"compression_alg"</literal></entry>
         <entry>string</entry>
         <entry>Compression algorithm. Both
-	   <literal>"compression_alg"</literal> and <literal>"compression_level"</literal>
-	   must be set in order to enable data compression.
-	 </entry>
+    <literal>"compression_alg"</literal> and <literal>"compression_level"</literal>
+    must be set in order to enable data compression.
+  </entry>
        </row>
Image

Note to self: we might should make fixer order canonical.

主要言語
PHP
スター
7
フォーク
5
平均マージ
8時間 38分
マージ済み PR(30日)
2

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

php/docbook-cs のほかの issue

php/docbook-cs の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。