Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Indentation fixing

Đang mở
#47 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
php
Lĩnh vực
tooling

Hướng nghiên cứu

Tìm fixer thụt lề hiện tại và tái hiện các ví dụ simpara và row từ issue. So sánh đầu ra của nó với XML mong đợi, bao gồm khoảng trắng ở đầu và thứ tự của các fixer; hoàn tất khi cả hai ví dụ được định dạng như minh họa mà không chuẩn hóa khoảng trắng sai cách.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
PHP
Star
7
Fork
5
Merge trung bình
8 giờ 38 phút
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của php/docbook-cs

Tất cả issue của php/docbook-cs

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.