GJF adds <p> tag prior to the <div> tag
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 38/100
Direzione di ricerca
Nel report non sono indicati né un file sorgente né un test. Riproduci il comportamento con l'esempio Test.java fornito e il comando google-java-format 1.24.0, quindi traccia il punto di ingresso della formattazione Javadoc per i tag a livello di blocco. Il lavoro è completato quando la formattazione non aggiunge più
prima di
e conserva la gestione prevista di- e dei tag
- di chiusura.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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> )
- Lingua principale
- Java
- Stelle
- 6.2k
- Fork
- 936
- Merge medio
- 6m
- PR unite (30g)
- 3
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di google/google-java-format
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
google/google-java-format#1094 · 1 commento ·
-
Complementary Teamups Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
google/google-java-format#1450 · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
google/google-java-format#1439 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
google/google-java-format#1436 · 2 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
google/google-java-format#1428 · 3 commenti ·
Tutte le issue di google/google-java-format
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
elastic/gradle-plugins#157 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
cryptomator/hub#497 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
johanhaleby/occurrent#1120 ·