Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

When Javadoc formatting is disabled, don't change javadoc so much

Offen
#789 4 Kommentare 7 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
30/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
java
Bereich
tooling

Rechercherichtung

Beginne damit, die bestehende Option --skip-javadoc-formatting und den Javadoc-Formatierungspfad nachzuverfolgen. Vergleiche ihr aktuelles Verhalten mit dem angeforderten vollständig deaktivierten Modus und den vorgeschlagenen Optionen zur selektiven Formatierung; „done“ sollte eine klar definierte Optionssemantik umfassen, die den Javadoc-Inhalt und die Einrückung bei deaktivierter Formatierung beibehält.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Javadoc formatting regularly gives undesired results and lags behind in its support for both Javadoc (esp. {@snippet ...}) and HTML (e.g. elements such as <section>, <article>, <figure>, <figcaption>, ... aren't properly supported, nor is wrapping a "block" with an <a> element, etc.).

With --skip-javadoc-formatting, the result is unusable as well, because indentation is still removed.

So because of the poor Javadoc formatting, and the inability to disable it altogether, it's impractical to format my Java code with GJF.

I propose to at least provide an option to disable Javadoc formatting altogether (i.e. not even adding asterisks or doing any alignment/indentation changes). Either by updating the semantics of --skip-javadoc-formatting, or by introducing a new option (e.g. --disable-javadoc-formatting).

It would also be helpful to have an option where GJF only formats pure Javadoc (i.e. anything within {@... } and lines that start with a tag) and leaves anything else untouched (with an additional option to specify tags to exclude, such as @snippet while it's unsupported).

Vorherrschende Sprache
Java
Sterne
6.2k
Forks
936
Ø Merge
6 Min.
Gemergte PRs (30 T.)
3

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus google/google-java-format

Alle Issues in google/google-java-format

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.