diffplug / diffplug/spotless

the Jackson Yaml linter removes code comments

Offen
#1,795 8 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
Java
Sterne
5.6k
Forks
559
Ø Merge
1 T. 14 Std.
Gemergte PRs (30 T.)
43

Beschreibung

If you are submitting a **bug**, please include the following:

- [ ] summary of problem
using spotlessApply with a the jackson yaml package included removes lines in yaml files that start with `#`.
- [ ] gradle or maven version
gradle 7.5
- [ ] spotless version
6.21.0
- [ ] operating system and version
osx Ventura
- [ ] copy-paste your full Spotless configuration block(s)
spotless {
java {
palantirJavaFormat()
// Added target as spotless was having problems with the groovy files.
target(project.fileTree(project.rootDir) {
include 'src/*/java/**/*.java'
// Excluded Controller because spotless is making it very hard to read.
exclude '**/Controller.java'
})
}
json {
target(
'.cicd/**/*.json',
'.primer/**/*.json',
'src/**/*.json'
)
gson().indentWithSpaces(2)
}
groovy {
importOrder('*', 'spock')
excludeJava(true)
}
yaml {
target 'src/**/*.yml', 'src/**/*.yaml'
jackson().yamlFeature('MINIMIZE_QUOTES', true)
}
}
- [ ] copy-paste the full content of any console errors emitted by `gradlew spotless[Apply/Check] --stacktrace`
no errors

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, den Bericht mit den YAML-Zielen `src/**/*.yml` und `src/**/*.yaml` unter Verwendung der gezeigten Konfiguration `jackson().yamlFeature('MINIMIZE_QUOTES', true)` nachzustellen. Führe `gradlew spotlessApply` aus und prüfe die YAML-Zeilen, die mit `#` beginnen; die Aufgabe gilt als abgeschlossen, wenn die Anwendung des Jackson-YAML-Linters diese Kommentare beibehält, ohne Fehler auszugeben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

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