GJF adds <p> tag prior to the <div> tag
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 38/100
Piste de recherche
Le rapport ne nomme aucun fichier source ni aucun test. Reproduisez le comportement avec l’exemple Test.java fourni et la commande google-java-format 1.24.0, puis suivez le point d’entrée du formatage Javadoc pour les balises de niveau bloc. C’est terminé lorsque le formatage n’ajoute plus
avant
et préserve le traitement attendu de- et des balises
- fermantes.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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> )
- Langage dominant
- Java
- Étoiles
- 6.2k
- Forks
- 936
- Merge moyen
- 6 min
- PR mergées (30 j)
- 2
Préparer son environnement
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de google/google-java-format
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
google/google-java-format#1094 · 1 commentaire ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
google/google-java-format#1439 · 1 commentaire ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 62/100
google/google-java-format#1436 · 2 commentaires ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 48/100
google/google-java-format#1428 · 4 commentaires ·
-
Eclipse
Difficulté 3/5 1-2 jours Accessibilité débutants 55/100
google/google-java-format#1417 ·
Toutes les issues de google/google-java-format
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
refinedmods/refinedstorage2#1414 · 1 commentaire ·
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
In Java's `LongBoundedSum`, setting `lower` to `Long.MIN_VALUE` under-estimates the sensitivityOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 73/100
google/differential-privacy#489 ·
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
ScyllaDB Manual: 3 broken linksOuvertelink-check link-check:manual
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100