-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from mdedetrich/add-header-to-new-file
Fix project source file headers
- Loading branch information
Showing
5 changed files
with
74 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Headers | ||
|
||
on: | ||
pull_request: | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
check-headers: | ||
name: Check headers | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Java 8 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 8 | ||
|
||
- name: Cache Coursier cache | ||
uses: coursier/cache-action@v6.4.0 | ||
|
||
- name: Check headers | ||
run: sbt +headerCheckAll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import sbt._ | ||
|
||
import de.heikoseeberger.sbtheader.HeaderPlugin | ||
import de.heikoseeberger.sbtheader.HeaderPlugin.{ autoImport => SbtHeaderKeys } | ||
|
||
object Header extends AutoPlugin { | ||
override lazy val requires = plugins.JvmPlugin && HeaderPlugin | ||
override lazy val trigger = allRequirements | ||
import SbtHeaderKeys.{ HeaderFileType, HeaderCommentStyle, HeaderLicense } | ||
|
||
override lazy val projectSettings = Seq( | ||
SbtHeaderKeys.headerMappings ++= Map( | ||
HeaderFileType.scala -> HeaderCommentStyle.cStyleBlockComment, | ||
HeaderFileType.java -> HeaderCommentStyle.cStyleBlockComment | ||
), | ||
SbtHeaderKeys.headerLicense := Some( | ||
HeaderLicense.Custom( | ||
"""|Sbt Pull Request Validator | ||
|Copyright Lightbend and Hewlett Packard Enterprise | ||
| | ||
|Licensed under Apache License 2.0 | ||
|SPDX-License-Identifier: Apache-2.0 | ||
| | ||
|See the NOTICE file distributed with this work for | ||
|additional information regarding copyright ownership. | ||
|""".stripMargin | ||
) | ||
) | ||
) | ||
} |
17 changes: 6 additions & 11 deletions
17
src/main/scala/com/github/sbt/pullrequestvalidator/ValidatePullRequest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters