google / google/google-java-format

GJF adds <p> tag prior to the <div> tag

Đang mở
#1,180 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
6.2k
Fork
937
Merge trung bình
6 phút
Pull request đã merge (30 ngày)
3

Mô tả

Detected at: https://github.com/checkstyle/checkstyle/issues/15865, User's got his answer at: https://github.com/checkstyle/checkstyle/issues/15865#issuecomment-2462352189

GJF adds `

` prior to `

` tag, but the style guide says that block-level tags should not be preceded by `

` tag:

https://google.github.io/styleguide/javaguide.html#s7.1.2-javadoc-paragraphs

```
HTML tags for other block-level elements, such as

    or , are not preceded with

    .
    ```

    Here's an example of it:

    ```
    01: /**
    02: * Plugin to standardize all directions to their appropriate abbreviation.
    03: *
    04: *

    Some javadoc here....

    05: *
    06: *

      07: *
    • Item - 1

    • 08: *
    • Item - 2

    • 09: *
    • Item - 3

    • 10: *

    11: *
    12: *

    This plugin assumes numbered streets have the correct suffix, when applicable.
    13: */
    14: public class Test {
    15: /** Some javadoc. */
    16: public static void main(String[] args) {
    17:
    18: }
    19: }
    20:
    ```

    ```
    $ java -jar .\checkstyle-10.20.1-all.jar -c .\google_checks.xml .\Test.java
    Starting audit...
    Audit done.
    ```

    ```
    $ java -jar .\google-java-format-1.24.0-all-deps.jar .\Test.java > TestUpdated.java
    ```

    ```
    01: /**
    02: * Plugin to standardize all directions to their appropriate abbreviation.
    03: *
    04: *

    Some javadoc here....

    05: *
    06: *

      07: *
    • Item - 1
      08: *
    • Item - 2
      09: *
    • Item - 3
      10: *

    11: *
    12: *

    This plugin assumes numbered streets have the correct suffix, when applicable.
    13: */
    14: public class Test {
    15: /** Some javadoc. */
    16: public static void main(String[] args) {}
    17: }
    18:
    ```

    ```
    java -jar .\checkstyle-10.20.1-all.jar -c .\google_checks.xml .\TestUpdated.java
    Starting audit...
    [WARN] C:\checkstyle testing\.\TestUpdated.java:4:4:

    tag should not precede HTML block-tag '

    ',

    tag should be removed. [JavadocParagraph]
    [WARN] C:\checkstyle testing\.\TestUpdated.java:14:1: The name of the outer type and the file do not match. [OuterTypeFilename]
    Audit done.
    ```

    Ignore the `OuterTypeFilename` violation.

    The formatter added `

    ` tag preceding to `

    ` tag, Checkstyle was complaining about it. But this did not happened in case of `
      ` tag, formatter didn't added preceding `

      ` tag to it.

      Edit: After formatting, GJF also removes closing li tags ( `` )

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

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.