spotless icon indicating copy to clipboard operation
spotless copied to clipboard

the Jackson Yaml linter removes code comments

Open bnorman405 opened this issue 2 years ago • 6 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] --stacktrace no errors

bnorman405 avatar Aug 30 '23 16:08 bnorman405

Any plan to fix this?

aldex32 avatar Oct 08 '23 10:10 aldex32

This is perhaps related to https://github.com/FasterXML/jackson-dataformats-text/issues/36 and in the end SnakeYaml?

henrikcaesar avatar Oct 20 '23 10:10 henrikcaesar

This is really unfortunate bug, I am considering the removal of yaml step because of it.

OksiBlack avatar Nov 03 '23 12:11 OksiBlack

@henrikcaesar SnakeYAML supports the comments.

asomov avatar Feb 15 '24 04:02 asomov

+100 for fix.i lost a lot of info when running this....

tim-oe avatar Jul 04 '24 02:07 tim-oe