GJF adds <p> tag prior to the <div> tag
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 38/100
Línea de trabajo
El informe no menciona ningún archivo fuente ni ninguna prueba. Reproduce el comportamiento con el ejemplo Test.java proporcionado y el comando google-java-format 1.24.0; después, sigue el punto de entrada del formateo de Javadoc para las etiquetas de nivel de bloque. Se considera completado cuando el formateo ya no añade
antes de
y conserva el tratamiento esperado de- y de las etiquetas
- de cierre.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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> )
- Lenguaje dominante
- Java
- Estrellas
- 6.2k
- Forks
- 936
- Merge medio
- 6 min
- PR fusionados (30 d)
- 3
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de google/google-java-format
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
google/google-java-format#1094 · 1 comentario ·
-
Complementary Teamups Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
google/google-java-format#1450 · 1 reacción ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
google/google-java-format#1439 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 62/100
google/google-java-format#1436 · 2 comentarios ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
google/google-java-format#1428 · 3 comentarios ·
Todos los issues de google/google-java-format
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
elastic/gradle-plugins#157 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
cryptomator/hub#497 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
johanhaleby/occurrent#1120 ·