vert.x icon indicating copy to clipboard operation
vert.x copied to clipboard

Make formatting and imports consistent across IDEs and editors

Open Stwissel opened this issue 4 years ago • 0 comments

Subtle IDE differences

Depending on IDE or editor (Eclipse, VSCode, IntelliJ) files are saved with subtle difference. E.g. sort order of imports, allowing wildcard imports, number of empty space to preserve, line breaks / merges

Use cases

  • enforce unified code layout
  • reduce "noise" in pull request due to white space / import changes

Implementation details

  • Create code style file (based on Google style, but merge lines switched off)
  • Create workspace file for VSCode
  • Update pom.xml to include the spotless plugin
  • document usage incl. how to setup a githook

See: https://wissel.net/blog/2021/12/spotless-code-with-a-git-hook.html

Contribution

Happy to implement

Stwissel avatar Jan 10 '22 13:01 Stwissel