Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
sbt headerCreateAll


This will for example add the standard Apache header to the top of the source files but it will also handle other cases such as adding the Apache SPDX header to configuration files.

All of Pekko projects run the header check on every PR which in addition to protected branches + strict status check helps alleviate regressions in license headers, i.e. using core Pekko project as an example

...

Info

Do note that while its possible to use other tools to check for headers (such as rat Apache Rat) its not recommend because all of the header requirements that resulted from legal discussions such as

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyLEGAL-626
which are specific/bespoke to Pekko and Pekko only are encoded into sbt-header and certain kinds of rules for checking header files aren't even possible in rat because they are programmatic in nature (see . This style of programmatic checking of headers (such as https://github.com/apache/incubator-pekko/blob/main/project/CopyrightHeader.scala as an example) isn't possible in Rat.

On top of this, since Pekko projects use sbt as a build tool, sbt-header (which is an sbt plugin) is aware of the difference between generated sources (i.e. from templates/macros) which are NOT part of the source distribution and actual sources. Rat cannot tell the difference which means it may incorrectly mark files as needing headers if you didn't clean the project after building it.

In short, Rat can provide both a lot of false positives and false negatives and although it can be configured to remediate some of these problems it won't solve all of them.