Skip to content

Source Code and license formatting

Hendrik Saly requested to merge code_license_formatting into main

This PR introduce spotless maven plugin to manage:

  • license headers
  • java source code formatting (via eclipse formatter)
  • pom formatting

Java and Pom formatting are not yet enabled because we need to get the licenses right. According to https://git.eliatra.com/eliatra-suite/eliatra-opensearch-plugin/-/issues/29 the spotless plugin does

  • Apply ee license to all ee projects (overwriting the old licenses)
  • Apply aslv2 to all non-ee projects (prepend new eli license header)

This should work automatically after a one time sanitization step:

  • Run ./dev/fix_headers.sh (can later be deleted if everything is ok)
    • This add missing aslv2 fg headers to non-ee projects
    • Add a comment "//== Original license headers ==" above the original license for non-ee projects (spotless needs this so that original license gets not overrridden)
  • Run mvn spotless:apply
  • Find code which we probably want to exclude from formatting and annotate it
  • Check everything - if all is ok commit, and delete ./dev/fix_headers.sh
Edited by Nils Bandener

Merge request reports

Loading