Skip to content
This repository has been archived by the owner on Oct 16, 2023. It is now read-only.

Commit

Permalink
gh-1001: Improve process for updating copyright headers (#1002)
Browse files Browse the repository at this point in the history
* Enable use of spotless copyright header check

* Remove checkstyle header checks

* Fix typo
  • Loading branch information
GCHQDeveloper314 authored Jul 13, 2022
1 parent 5e1a304 commit af2d22a
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 25 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ jobs:
env:
MAVEN_OPTS: -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup JDK
uses: actions/setup-java@v2
Expand All @@ -133,5 +135,9 @@ jobs:
- name: Test
run: mvn verify -B -P coverage -pl ${{matrix.modules}}

- name: Check Copyright Headers
if: github.event_name == 'pull_request'
run: mvn -B -q spotless:check -pl ${{matrix.modules}}

- name: Upload Coverage
uses: codecov/codecov-action@v2
4 changes: 0 additions & 4 deletions code-style/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
<property name="id" value="fileTabChar"/>
<property name="eachLine" value="true"/>
</module>
<module name="RegexpHeader">
<property name="id" value="headerCheck"/>
<property name="headerFile" value="${checkstyle.header.file}"/>
</module>

<module name="RegexpSingleline">
<property name="id" value="trailingSpaces"/>
Expand Down
16 changes: 16 additions & 0 deletions code-style/licence-header-java.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright $YEAR Crown Copyright
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

17 changes: 17 additions & 0 deletions code-style/licence-header-pom.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright $YEAR Crown Copyright
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

15 changes: 0 additions & 15 deletions code-style/licenseHeader.txt

This file was deleted.

6 changes: 1 addition & 5 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2016-2019 Crown Copyright
~ Copyright 2016-2022 Crown Copyright
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -85,8 +85,6 @@
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<headerLocation>code-style/licenseHeader.txt
</headerLocation>
<excludes>**/generated/**/*</excludes>
<sourceDirectories>
<sourceDirectory>${project.build.sourceDirectory}
Expand All @@ -105,8 +103,6 @@
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<headerLocation>code-style/licenseHeader.txt
</headerLocation>
</configuration>
<goals>
<goal>check</goal>
Expand Down

0 comments on commit af2d22a

Please sign in to comment.