Skip to content

Commit b1f6ce2

Browse files
authored
#672 - Added license and formatting checker (#684)
#672 - Added license checker #672 - Added formatting checker
1 parent abd1511 commit b1f6ce2

File tree

225 files changed

+4770
-3433
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

225 files changed

+4770
-3433
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
#
2+
# Copyright 2018 ABSA Group Limited
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
116
name: build
217

318
on:
@@ -16,4 +31,4 @@ jobs:
1631
with:
1732
java-version: 1.8
1833
- name: Run tests
19-
run: mvn clean test --no-transfer-progress -Plicense-check,all-tests
34+
run: mvn clean test --no-transfer-progress -Pall-tests
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#
2+
# Copyright 2018 ABSA Group Limited
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
16+
name: formatting check
17+
18+
on:
19+
pull_request:
20+
branches:
21+
- '**'
22+
23+
jobs:
24+
license-test:
25+
name: formatting check
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v2
29+
- name: Set up JDK 1.8
30+
uses: actions/setup-java@v1
31+
with:
32+
java-version: 1.8
33+
- name: Run formatting check
34+
run: mvn --no-transfer-progress scalafmt:format -Dformat.validateOnly=true
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#
2+
# Copyright 2018 ABSA Group Limited
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
16+
name: license check
17+
18+
on:
19+
pull_request:
20+
branches:
21+
- '**'
22+
23+
jobs:
24+
license-test:
25+
name: license check
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v2
29+
- name: Set up JDK 1.8
30+
uses: actions/setup-java@v1
31+
with:
32+
java-version: 1.8
33+
- name: Run license check
34+
run: mvn --no-transfer-progress apache-rat:check

.scalafmt.conf

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#
2+
# Copyright 2018 ABSA Group Limited
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
16+
version = "3.5.3"
17+
runner.dialect = scala212
18+
19+
maxColumn = 120
20+
21+
align.preset = some
22+
align.multiline = false
23+
24+
indent.main = 2
25+
indent.defnSite = 2
26+
27+
lineEndings = unix
28+
29+
docstrings.blankFirstLine = yes
30+
docstrings.style = AsteriskSpace
31+
docstrings.wrap = no
32+
docstrings.removeEmpty = true
33+
34+
align.openParenDefnSite = true
35+
align.openParenCallSite = true

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018-2020 ABSA Group Limited
1+
# Copyright 2018 ABSA Group Limited
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,11 @@ Then, the liquibase maven plugin can be executed, e.g.
267267
- `mvn liquibase:dropAll` to drop all tables, views etc.
268268
- `mvn liquibase:update` to apply all pending changesets
269269

270+
## License and formatting
271+
- `mvn apache-rat:check` to verify required copyright headers
272+
- `mvn scalafmt:format -Dformat.validateOnly=true` to validate scala files formatting
273+
- `mvn scalafmt:format` or `mvn scalafmt:format -Dformat.validateOnly=false` to apply correct scala file formatting
274+
270275
# User Interface
271276
- **Workflows**: Overview of all workflows.
272277
![](/docs/img/all_workflows.png)

buildspec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2018-2020 ABSA Group Limited
2+
# Copyright 2018 ABSA Group Limited
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018-2020 ABSA Group Limited
1+
# Copyright 2018 ABSA Group Limited
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

pom.xml

Lines changed: 54 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -597,22 +597,6 @@
597597
<tagNameFormat>v@{project.version}</tagNameFormat>
598598
</configuration>
599599
</plugin>
600-
<plugin>
601-
<groupId>org.apache.rat</groupId>
602-
<artifactId>apache-rat-plugin</artifactId>
603-
<configuration>
604-
<excludes combine.children="append">
605-
<exclude>**/node/**</exclude>
606-
<exclude>**/node_modules/**</exclude>
607-
<exclude>**/build.yml</exclude>
608-
<exclude>**/.editorconfig</exclude>
609-
<exclude>.dockerignore</exclude>
610-
<exclude>**/.gitkeep</exclude>
611-
<exclude>src/main/resources/banner.txt</exclude>
612-
<exclude>**/CODEOWNERS</exclude>
613-
</excludes>
614-
</configuration>
615-
</plugin>
616600
<plugin>
617601
<groupId>pl.project13.maven</groupId>
618602
<artifactId>git-commit-id-plugin</artifactId>
@@ -636,6 +620,60 @@
636620
<commitIdGenerationMode>full</commitIdGenerationMode>
637621
</configuration>
638622
</plugin>
623+
<plugin>
624+
<groupId>org.apache.rat</groupId>
625+
<artifactId>apache-rat-plugin</artifactId>
626+
<configuration>
627+
<addDefaultLicenseMatchers>false</addDefaultLicenseMatchers>
628+
<consoleOutput>true</consoleOutput>
629+
<excludes combine.children="append">
630+
<exclude>**/node/**</exclude>
631+
<exclude>**/node_modules/**</exclude>
632+
<exclude>**/.editorconfig</exclude>
633+
<exclude>.dockerignore</exclude>
634+
<exclude>**/.gitkeep</exclude>
635+
<exclude>src/main/resources/banner.txt</exclude>
636+
<exclude>**/CODEOWNERS</exclude>
637+
<exclude>ui/.angular/**</exclude>
638+
<exclude>ui/**.json</exclude>
639+
<exclude>ui/e2e/tsconfig.json</exclude>
640+
<exclude>ui/src/proxy.conf.json</exclude>
641+
<exclude>logs/**</exclude>
642+
</excludes>
643+
<licenses>
644+
<license implementation="org.apache.rat.analysis.license.FullTextMatchingLicense">
645+
<licenseFamilyCategory>AL2</licenseFamilyCategory>
646+
<licenseFamilyName>Apache License 2</licenseFamilyName>
647+
<fullText>Copyright 2018 ABSA Group Limited
648+
649+
Licensed under the Apache License, Version 2.0 (the "License");
650+
you may not use this file except in compliance with the License.
651+
You may obtain a copy of the License at
652+
http://www.apache.org/licenses/LICENSE-2.0
653+
654+
Unless required by applicable law or agreed to in writing, software
655+
distributed under the License is distributed on an "AS IS" BASIS,
656+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
657+
See the License for the specific language governing permissions and
658+
limitations under the License.
659+
</fullText>
660+
</license>
661+
</licenses>
662+
<licenseFamilies>
663+
<licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
664+
<familyName>Apache License 2</familyName>
665+
</licenseFamily>
666+
</licenseFamilies>
667+
</configuration>
668+
</plugin>
669+
<plugin>
670+
<groupId>org.antipathy</groupId>
671+
<artifactId>mvn-scalafmt_${scala.compat.version}</artifactId>
672+
<version>1.1.1640084764.9f463a9</version>
673+
<configuration>
674+
<configLocation>${project.basedir}/.scalafmt.conf</configLocation>
675+
</configuration>
676+
</plugin>
639677
</plugins>
640678
</build>
641679

src/main/scala/org/apache/spark/launcher/NoBackendConnectionInProcessLauncher.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* Copyright 2018 ABSA Group Limited
43
*

0 commit comments

Comments
 (0)