set license headers on conf files (#227)

This commit is contained in:
PJ Fanning 2023-03-03 13:24:19 +01:00 committed by GitHub
parent 4a36d2600e
commit 0a8b8a572f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 169 additions and 54 deletions

View file

@ -9,6 +9,7 @@ You're always welcome to submit your PR straight away and start the discussion (
If you have questions about the contribution process or discuss specific issues, please interact with the community using the following resources.
- [GitHub discussions](https://github.com/apache/incubator-pekko/discussions): for questions and general discussion.
- [Pekko user mailing list](https://lists.apache.org/list.html?user@pekko.apache.org): for Pekko usage discussions.
- [Pekko dev mailing list](https://lists.apache.org/list.html?dev@pekko.apache.org): for Pekko development discussions.
- [GitHub issues](https://github.com/apache/incubator-pekko/issues): for bug reports and feature requests. Please search the existing issues before creating new ones. If you are unsure whether you have found a bug, consider asking in GitHub discussions or the mailing list first.

View file

@ -1,6 +1,8 @@
##################################################
# SPDX-License-Identifier: Apache-2.0
###################################################
# Pekko Actor Typed Testkit Reference Config File #
##################################################
###################################################
# This is the reference config file that contains all the default settings.
# Make your edits/overrides in your application.conf.

View file

@ -1,2 +1,4 @@
# SPDX-License-Identifier: Apache-2.0
# used by ActorTestKitSpec
test.from-application-test = yes

View file

@ -1,2 +1,4 @@
# SPDX-License-Identifier: Apache-2.0
# used by ActorTestKitSpec
test.from-application = yes

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
pekko {
# for the org.apache.pekko.actor.ExtensionSpec
library-extensions += "org.apache.pekko.actor.InstanceCountingExtension"

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
my-app {
my-special-mailbox {
mailbox-type = "org.apache.pekko.dispatch.SingleConsumerOnlyUnboundedMailbox"

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
pekko.actor.typed {
# List FQCN of `org.apache.pekko.actor.typed.ExtensionId`s which shall be loaded at actor system startup.

View file

@ -1,6 +1,8 @@
####################################
# SPDX-License-Identifier: Apache-2.0
#####################################
# Pekko Actor Reference Config File #
####################################
########################3############
# This is the reference config file that contains all the default settings.
# Make your edits/overrides in your application.conf.

View file

@ -1,6 +1,8 @@
##############################################
# SPDX-License-Identifier: Apache-2.0
###############################################
# Pekko Cluster Metrics Reference Config File #
##############################################
###############################################
# This is the reference config file that contains all the default settings.
# Make your edits in your application.conf in order to override these settings.

View file

@ -1,3 +1,4 @@
# SPDX-License-Identifier: Apache-2.0
# //#sharding-ext-config
# //#number-of-shards

View file

@ -1,6 +1,8 @@
###############################################
# SPDX-License-Identifier: Apache-2.0
################################################
# Pekko Cluster Sharding Reference Config File #
###############################################
#######################3########################
# This is the reference config file that contains all the default settings.
# Make your edits/overrides in your application.conf.

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
#
# Run a joined trace for testing adaptivity, switching between a recency-biased R3 Corda trace and
# a frequency-biased LIRS loop trace.

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
#
# Run the "database" trace (DS1) from the authors of the ARC algorithm.
#

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
#
# Run the merged "search" trace (MergeS) from the authors of the ARC algorithm.
#

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
#
# Run the "glimpse" trace (gli.trace) from the authors of the LIRS algorithm.
#

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
#
# Run the "multi3" trace (multi3.trace) from the authors of the LIRS algorithm.
#

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
#
# Run the "postgres" trace (ps.trace) from the authors of the LIRS algorithm.
#

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
#
# Run the "w106" binary trace (w106.trace) from the authors of the LIRS2 algorithm.
#

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
pekko.cluster.sharding {
passivation.simulator {
runs = []

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
#
# Run with synthetically generated access events with a looping scan through ids.
#

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
#
# Run with synthetically generated access events with a scrambled zipfian distribution.
#

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
#
# Run against the text of Moby Dick, for a natural zipfian-like distribution.
#

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
#
# Run the 14-day Wikipedia trace from 2018 (wiki2018.tr) from the LRB simulator.
#

View file

@ -1,6 +1,8 @@
############################################
# SPDX-License-Identifier: Apache-2.0
#############################################
# Pekko Cluster Tools Reference Config File #
############################################
#############################################
# This is the reference config file that contains all the default settings.
# Make your edits/overrides in your application.conf.

View file

@ -1,6 +1,8 @@
############################################
# SPDX-License-Identifier: Apache-2.0
#############################################
# Pekko Cluster Typed Reference Config File #
############################################
#############################################
# This is the reference config file that contains all the default settings.
# Make your edits/overrides in your application.conf.

View file

@ -1,6 +1,8 @@
######################################
# SPDX-License-Identifier: Apache-2.0
#######################################
# Pekko Cluster Reference Config File #
######################################
#######################################
# This is the reference config file that contains all the default settings.
# Make your edits/overrides in your application.conf.

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
pekko.coordination {
# Defaults for any lease implementation that doesn't include these properties

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
######################################################
# Pekko Discovery Config #
######################################################

View file

@ -1,6 +1,8 @@
##############################################
# SPDX-License-Identifier: Apache-2.0
###############################################
# Pekko Distributed DataReference Config File #
##############################################
###############################################
# This is the reference config file that contains all the default settings.
# Make your edits/overrides in your application.conf.

View file

@ -1 +1,3 @@
# SPDX-License-Identifier: Apache-2.0
pekko.loggers = ["org.apache.pekko.testkit.TestEventListener"]

View file

@ -1,6 +1,8 @@
#############################################
# SPDX-License-Identifier: Apache-2.0
##############################################
# Pekko Remote Testing Reference Config File #
#############################################
##############################################
# This is the reference config file that contains all the default settings.
# Make your edits/overrides in your application.conf.

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
#######################################################
# Pekko Persistence Query Reference Configuration File #
#######################################################

View file

@ -1,6 +1,8 @@
##################################################
# SPDX-License-Identifier: Apache-2.0
###################################################
# Pekko Persistence Testkit Reference Config File #
##################################################
###################################################
# This is the reference config file that contains all the default settings.
# Make your edits/overrides in your application.conf.

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
pekko.persistence.testkit {
events {
assert-timeout = 500ms

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
pekko.actor {
serialization-identifiers."org.apache.pekko.persistence.typed.serialization.ReplicatedEventSourcingSerializer" = 40

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
###########################################################
# Pekko Persistence Extension Reference Configuration File #
###########################################################

View file

@ -37,7 +37,17 @@ trait CopyrightHeader extends AutoPlugin {
HeaderFileType("template") -> cStyleComment)))
}
override def projectSettings: Seq[Def.Setting[_]] = headerMappingSettings
private def confHeaderMappingSettings: Seq[Def.Setting[_]] =
Seq(Compile, Test).flatMap { config =>
inConfig(config)(
Seq(
headerLicense := Some(HeaderLicense.Custom(apacheSpdxHeader)),
headerMappings := headerMappings.value ++ Map(
HeaderFileType.conf -> hashLineComment)))
}
override def projectSettings: Seq[Def.Setting[_]] =
Def.settings(headerMappingSettings, confHeaderMappingSettings, additional)
def additional: Seq[Def.Setting[_]] =
Def.settings(Compile / compile := {
@ -61,41 +71,58 @@ trait CopyrightHeader extends AutoPlugin {
|This file is part of the Apache Pekko project, derived from Akka.
|""".stripMargin
val apacheSpdxHeader: String = "SPDX-License-Identifier: Apache-2.0"
val cStyleComment = HeaderCommentStyle.cStyleBlockComment.copy(commentCreator = new CommentCreator() {
override def apply(text: String, existingText: Option[String]): String = {
val formatted = existingText match {
case Some(existedText) if isValidCopyrightAnnotated(existedText) =>
existedText
case Some(existedText) if isOnlyLightbendOrEpflCopyrightAnnotated(existedText) =>
HeaderCommentStyle.cStyleBlockComment.commentCreator(text, existingText) + NewLine * 2 + existedText
case Some(existedText) =>
throw new IllegalStateException(s"Unable to detect copyright for header:[${existedText}]")
case Some(currentText) if isValidCopyrightAnnotated(currentText) =>
currentText
case Some(currentText) if isOnlyLightbendOrEpflCopyrightAnnotated(currentText) =>
HeaderCommentStyle.cStyleBlockComment.commentCreator(text, existingText) + NewLine * 2 + currentText
case Some(currentText) =>
throw new IllegalStateException(s"Unable to detect copyright for header:[${currentText}]")
case None =>
HeaderCommentStyle.cStyleBlockComment.commentCreator(text, existingText)
}
formatted.trim
}
private def isApacheCopyrighted(text: String): Boolean =
StringUtils.containsIgnoreCase(text, "licensed to the apache software foundation (asf)") ||
StringUtils.containsIgnoreCase(text, "www.apache.org/licenses/license-2.0")
private def isLAMPCopyrighted(text: String): Boolean =
StringUtils.containsIgnoreCase(text, "lamp/epfl")
private def isLightbendCopyrighted(text: String): Boolean =
StringUtils.containsIgnoreCase(text, "lightbend inc.")
private def isValidCopyrightAnnotated(text: String): Boolean = {
isApacheCopyrighted(text)
}
private def isOnlyLightbendOrEpflCopyrightAnnotated(text: String): Boolean = {
(isLightbendCopyrighted(text) || isLAMPCopyrighted(text)) && !isApacheCopyrighted(text)
}
})
val hashLineComment = HeaderCommentStyle.hashLineComment.copy(commentCreator = new CommentCreator() {
override def apply(text: String, existingText: Option[String]): String = {
val formatted = existingText match {
case Some(currentText) if isApacheCopyrighted(currentText) =>
currentText
case Some(currentText) =>
HeaderCommentStyle.hashLineComment.commentCreator(text, existingText) + NewLine * 2 + currentText
case None =>
HeaderCommentStyle.hashLineComment.commentCreator(text, existingText)
}
formatted.trim
}
})
private def isApacheCopyrighted(text: String): Boolean =
StringUtils.containsIgnoreCase(text, "licensed to the apache software foundation (asf)") ||
StringUtils.containsIgnoreCase(text, "www.apache.org/licenses/license-2.0") ||
StringUtils.contains(text, "Apache-2.0")
private def isLAMPCopyrighted(text: String): Boolean =
StringUtils.containsIgnoreCase(text, "lamp/epfl")
private def isLightbendCopyrighted(text: String): Boolean =
StringUtils.containsIgnoreCase(text, "lightbend inc.")
private def isValidCopyrightAnnotated(text: String): Boolean = {
isApacheCopyrighted(text)
}
private def isOnlyLightbendOrEpflCopyrightAnnotated(text: String): Boolean = {
(isLightbendCopyrighted(text) || isLAMPCopyrighted(text)) && !isApacheCopyrighted(text)
}
}
object CopyrightHeader extends CopyrightHeader

View file

@ -1,7 +1,9 @@
# SPDX-License-Identifier: Apache-2.0
#//#shared
#####################################
######################################
# Pekko Remote Reference Config File #
#####################################
######################################
# This is the reference config file that contains all the default settings.
# Make your edits/overrides in your application.conf.

View file

@ -1,6 +1,8 @@
##########################################
# SPDX-License-Identifier: Apache-2.0
###########################################
# Pekko Serialization Jackson Config File #
##########################################
###########################################
# This is the reference config file that contains all the default settings.
# Make your edits/overrides in your application.conf.

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
pekko {
actor {
serialization-bindings {

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
pekko.stream.testkit {
all-stages-stopped-timeout = 5 s
}

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# The StreamTestDefaultMailbox verifies that stream actors are using the dispatcher defined in ActorMaterializerSettings.
#
# All stream tests should use the dedicated `pekko.test.stream-dispatcher` or disable this validation by defining:

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
pekko {
loggers = ["org.apache.pekko.testkit.TestEventListener"]
actor {

View file

@ -1,6 +1,8 @@
#####################################
# SPDX-License-Identifier: Apache-2.0
######################################
# Pekko Stream Reference Config File #
#####################################
######################################
# eager creation of the system wide materializer
pekko.library-extensions += "org.apache.pekko.stream.SystemMaterializer$"

View file

@ -1,6 +1,8 @@
######################################
# SPDX-License-Identifier: Apache-2.0
#######################################
# Pekko Testkit Reference Config File #
######################################
#######################################
# This is the reference config file that contains all the default settings.
# Make your edits/overrides in your application.conf.

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
pekko {
# Configures MetricsKit
test.metrics {