spotless
spotless copied to clipboard
the Jackson Yaml linter removes code comments
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] --stacktraceno errors
Any plan to fix this?
This is perhaps related to https://github.com/FasterXML/jackson-dataformats-text/issues/36 and in the end SnakeYaml?
This is really unfortunate bug, I am considering the removal of yaml step because of it.
@henrikcaesar SnakeYAML supports the comments.
+100 for fix.i lost a lot of info when running this....