GJF adds <p> tag prior to the <div> tag
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 38/100
Rechercherichtung
Im Bericht wird weder eine Quelldatei noch ein Test genannt. Reproduziere das Verhalten mit dem bereitgestellten Test.java-Beispiel und dem Befehl google-java-format 1.24.0 und verfolge anschließend den Einstiegspunkt der Javadoc-Formatierung für Tags auf Blockebene. Als erledigt gilt die Aufgabe, wenn die Formatierung vor
keinmehr hinzufügt und die erwartete Behandlung von
- sowie schließenden
- -Tags beibehält.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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 <p> prior to <div> tag, but the style guide says that block-level tags should not be preceded by <p> tag:
https://google.github.io/styleguide/javaguide.html#s7.1.2-javadoc-paragraphs
HTML tags for other block-level elements, such as <ul> or <table>, are not preceded with <p>.
Here's an example of it:
01: /**
02: * Plugin to standardize all directions to their appropriate abbreviation.
03: *
04: * <div>Some javadoc here....</div>
05: *
06: * <ul>
07: * <li>Item - 1 </li>
08: * <li>Item - 2 </li>
09: * <li>Item - 3 </li>
10: * </ul>
11: *
12: * <p>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: * <p><div>Some javadoc here....</div>
05: *
06: * <ul>
07: * <li>Item - 1
08: * <li>Item - 2
09: * <li>Item - 3
10: * </ul>
11: *
12: * <p>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: <p> tag should not precede HTML block-tag '<div>', <p> 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 <p> tag preceding to <div> tag, Checkstyle was complaining about it. But this did not happened in case of <ul> tag, formatter didn't added preceding <p> tag to it.
Edit: After formatting, GJF also removes closing li tags ( </li> )
- Vorherrschende Sprache
- Java
- Sterne
- 6.2k
- Forks
- 940
- Ø Merge
- 5 Min.
- Gemergte PRs (30 T.)
- 8
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus google/google-java-format
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
google/google-java-format#1094 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
google/google-java-format#1470 · 5 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
IndexOutOfBoundsException - Wrong formatted content when dealing with latex StringEvtl. wieder frei @Amlan2000 hat das vor 57 Tagen übernommen, und es ist kein Pull Request offen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
google/google-java-format#1439 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
unused import removal leaves extra blank line between package declaration and class Javadoc / declarationEvtl. vergeben @arimu1 hat das vor 67 Tagen übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 62/100
google/google-java-format#1436 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Eclipse
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 48/100
google/google-java-format#1428 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in google/google-java-format
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
openhab/openhab-addons#21921 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
objectionary/eo-graphs#85 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
objectionary/lints#1544 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
objectionary/hone-maven-plugin#1309 ·
Maintainer antworten meist innerhalb von 1 Tag
-
chore s3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
Maintainer antworten meist innerhalb von 1 Tag