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

Disambiguating multiple formatted files when writing to standard output

Offen
#994 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
38/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
java
Bereich
cli

Rechercherichtung

Beginne mit dem im Issue gezeigten Aufruf der google-java-format CLI und konzentriere dich auf die Formatierung mehrerer Dateien, die an die Standardausgabe gesendet wird. Ermittle eine eindeutige Möglichkeit, jedes formatierte Ergebnis seinem Quellpfad zuzuordnen, und überprüfe anschließend das Verhalten anhand des Beispiels mit vier Dateien und einer äquivalenten Stapelverarbeitung der Eingabe.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

When using google-java-format to format multiple files and print their formatted results to standard-out, it's unclear how I'm supposed to disambiguate between the results in the output. For performance reasons, I am running google-java-format against my codebase in batches of 100 files at a time, and for various other reasons, formatting in-place is not preferred.

For example, running this:

java -jar $HOME/bin/google-java-format --aosp path/to/file1.java path/to/file2.java path/to/file3.java path/to/file4.java

results in output like this:

/* my file 1 */

public class File1 {
    // ...
}
/* my file 2 */

public class File2 {
    // ...
}
/* my file 3 */

public class File3 {
    // ...
}
/* my file 4 */

public class File4 {
    // ...
}

This example is kind of contrived, but the main point is that the end of file1.java and the start of file2.java, and so on, are not delimited in a clear way. What can I do here to clearly associate the output for each formatted file with its source path?

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.