Skip to content

Commit 9fc3788

Browse files
committed
chore: improve license header checker confs and pre-check header when validating (#2445)
* improve license header checker confs * typo * verify -> validate * update rat exclude files * empty commit * update rat exclude files * update rat exclude files
1 parent 168cf69 commit 9fc3788

File tree

3 files changed

+43
-20
lines changed

3 files changed

+43
-20
lines changed

.github/workflows/licence-checker.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
token: ${{ github.token }}
2525
config: .licenserc.yaml
2626

27-
- name: License check(RAT)
27+
- name: License Check (RAT)
2828
run: |
2929
mvn apache-rat:check -ntp
3030
find ./ -name rat.txt -print0 | xargs -0 -I file cat file > merged-rat.txt

.licenserc.yaml

+21-18
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,30 @@ header: # `header` section is configurations for source codes license header.
2626
The ASF licenses this file to You under the Apache License, Version 2.0
2727
(the "License"); you may not use this file except in compliance with
2828
the License. You may obtain a copy of the License at
29+
2930
http://www.apache.org/licenses/LICENSE-2.0
31+
3032
Unless required by applicable law or agreed to in writing, software
3133
distributed under the License is distributed on an "AS IS" BASIS,
3234
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3335
See the License for the specific language governing permissions and
3436
limitations under the License.
3537
# `pattern` is optional regexp if all the file headers are the same as `license` or the license of `spdx-id` and `copyright-owner`.
3638
pattern: |
37-
Licensed to the Apache Software Foundation under one or more contributor
38-
license agreements. See the NOTICE file distributed with
39-
this work for additional information regarding copyright
40-
ownership. The Apache Software Foundation licenses this file to you under
41-
the Apache License, Version 2.0 \(the "License"\); you may
42-
not use this file except in compliance with the License.
43-
You may obtain a copy of the License at
39+
Licensed to the Apache Software Foundation \(ASF\) under one or more
40+
contributor license agreements. See the NOTICE file distributed with
41+
this work for additional information regarding copyright ownership.
42+
The ASF licenses this file to You under the Apache License, Version 2.0
43+
\(the "License"\); you may not use this file except in compliance with
44+
the License. You may obtain a copy of the License at
45+
4446
http://www.apache.org/licenses/LICENSE-2.0
45-
Unless required by applicable law or agreed to in writing,
46-
software distributed under the License is distributed on an
47-
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
48-
KIND, either express or implied. See the License for the
49-
specific language governing permissions and limitations
50-
under the License.
47+
48+
Unless required by applicable law or agreed to in writing, software
49+
distributed under the License is distributed on an "AS IS" BASIS,
50+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
51+
See the License for the specific language governing permissions and
52+
limitations under the License.
5153
paths: # `paths` are the path list that will be checked (and fixed) by license-eye, default is ['**'].
5254
- '**'
5355

@@ -89,14 +91,15 @@ header: # `header` section is configurations for source codes license header.
8991
- '**/META-INF/MANIFEST.MF'
9092
- '.repository/**'
9193
- '**/.flattened-pom.xml'
92-
- '**/optimize/HugeScriptTraversal.java'
93-
- '**/type/Nameable.java'
94-
- '**/define/Cardinality.java'
95-
- '**/util/StringEncoding.java'
9694
# TODO: temporarily added to the ignore list, need handle them before releases ( ↓ )
95+
- 'hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/id/SnowflakeIdGenerator.java'
96+
- 'hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/optimize/HugeScriptTraversal.java'
97+
- 'hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/type/Nameable.java'
98+
- 'hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/type/define/Cardinality.java'
99+
- 'hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/util/StringEncoding.java'
100+
- 'hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/tinkerpop/ProcessBasicSuite.java'
97101
- 'hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/opencypher/CypherOpProcessor.java'
98102
- 'hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/opencypher/CypherPlugin.java'
99-
- 'hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/id/SnowflakeIdGenerator.java'
100103
- 'hugegraph-store/hg-store-node/src/main/java/org/apache/hugegraph/store/node/metrics/ProcfsEntry.java'
101104
- 'hugegraph-store/hg-store-node/src/main/java/org/apache/hugegraph/store/node/metrics/ProcfsReader.java'
102105
- 'hugegraph-store/hg-store-node/src/main/java/org/apache/hugegraph/store/node/metrics/ProcfsSmaps.java'

pom.xml

+21-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
<exclude>**/*.map</exclude>
151151
<exclude>**/*.properties</exclude>
152152
<exclude>dist/**/*</exclude>
153-
<exclude>**/assembly/static/bin/hugegraph.service</exclude>
153+
<exclude>**/bin/hugegraph.service</exclude>
154154
<exclude>**/swagger-ui/**/*</exclude>
155155
<exclude>scripts/dev/reviewers</exclude>
156156
<exclude>scripts/dev/reviewers</exclude>
@@ -176,6 +176,11 @@
176176
<!-- Maven -->
177177
<exclude>.repository/**</exclude>
178178
<exclude>**/.flattened-pom.xml</exclude>
179+
<!-- Test generated data -->
180+
<exclude>**/rocksdb-*/**</exclude>
181+
<exclude>**/hbase-*/**</exclude>
182+
<exclude>**/apache-cassandra-*/**</exclude>
183+
<exclude>**/pid</exclude>
179184
</excludes>
180185
<consoleOutput>true</consoleOutput>
181186
</configuration>
@@ -208,6 +213,21 @@
208213
</plugin>
209214
</plugins>
210215
</pluginManagement>
216+
<plugins>
217+
<plugin>
218+
<groupId>org.apache.rat</groupId>
219+
<artifactId>apache-rat-plugin</artifactId>
220+
<executions>
221+
<execution>
222+
<id>license-check</id>
223+
<goals>
224+
<goal>check</goal>
225+
</goals>
226+
<phase>validate</phase>
227+
</execution>
228+
</executions>
229+
</plugin>
230+
</plugins>
211231
</build>
212232

213233
<profiles>

0 commit comments

Comments
 (0)