This is an automated email from the ASF dual-hosted git repository.
timbrown pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-xtable.git
The following commit(s) were added to refs/heads/main by this push:
new ae37054b License header check
ae37054b is described below
commit ae37054bccd428e3c5edf8f82400b7a7a98d036b
Author: wuchunfu <[email protected]>
AuthorDate: Sun Mar 3 00:00:03 2024 +0800
License header check
---
.github/workflows/license-check.yaml | 42 ++++++++++++++++++++++++++++++++
.licenserc.yaml | 46 ++++++++++++++++++++++++++++++++++++
README.md | 30 +++++++++++++++++++++++
3 files changed, 118 insertions(+)
diff --git a/.github/workflows/license-check.yaml
b/.github/workflows/license-check.yaml
new file mode 100644
index 00000000..fa27bae2
--- /dev/null
+++ b/.github/workflows/license-check.yaml
@@ -0,0 +1,42 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+#
+---
+name: License Check
+on:
+ pull_request_target:
+ push:
+ branches:
+ - main
+concurrency:
+ group: license-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+jobs:
+ license-check:
+ name: "License header"
+ runs-on: ubuntu-latest
+ timeout-minutes: 10
+ steps:
+ - name: "Checkout"
+ uses: actions/checkout@v4
+ with:
+ submodules: true
+ - name: "Check license header"
+ uses: apache/skywalking-eyes/header@main
+ with:
+ log: info
+ config: .licenserc.yaml
+ mode: check
diff --git a/.licenserc.yaml b/.licenserc.yaml
new file mode 100644
index 00000000..538d869b
--- /dev/null
+++ b/.licenserc.yaml
@@ -0,0 +1,46 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+#
+header:
+ license:
+ spdx-id: Apache-2.0
+ copyright-owner: Apache Software Foundation
+
+ paths-ignore:
+ - NOTICE
+ - LICENSE
+ - DISCLAIMER
+ - mvnw.cmd
+ - .mvn
+ - .gitmodules
+ - .gitattributes
+ - .github/actions
+ - '**/known-dependencies-*.txt'
+ - '**/*.md'
+ - '**/*.mdx'
+ - '**/*.json'
+ - '**/*.iml'
+ - '**/*.ini'
+ - '**/*.crt'
+ - '**/*.pem'
+ - '**/*.txt'
+ - '**/*.csv'
+ - '**/*.svg'
+ - '**/.gitignore'
+ - '**/LICENSE'
+ - '**/NOTICE'
+ - '**/.gitkeep'
+ comment: on-failure
diff --git a/README.md b/README.md
index 308a7b6c..be15659f 100644
--- a/README.md
+++ b/README.md
@@ -99,6 +99,36 @@ The custom hadoop configurations can be passed in with the
`--hadoopConfig [cust
The config in custom hadoop config file will override the default hadoop
configurations. For an example
of a custom hadoop config file, see
[hadoop.xml](https://xtable.apache.org/docs/fabric#step-2-translate-source-table-to-delta-lake-format-using-apache-xtable-incubating).
+# New file type spotless automatic formatting and modification operation
+
+When a new type of file is merged into the warehouse, it is possible that the
`spotless-maven-plugin` will not add the license header by default, and when it
is detected by ci and prompted to add the `license header`, what we have to do
is to modify the project. The modified part of `pom.xml` under the root path is
as follows:
+
+```xml
+<formats>
+ <format>
+ <includes>
+ <include>**/*.properties</include>
+ <include>**/*.config</include>
+ </includes>
+ <excludes>
+ <exclude>demo/data/**</exclude>
+ <exclude>${target.dir.pattern}</exclude>
+ <exclude>website/node_modules/**</exclude>
+ <exclude>website/build/**</exclude>
+ <exclude>website/.docusaurus/**</exclude>
+ </excludes>
+ <licenseHeader>
+ <file>style/text-license-header</file>
+ <delimiter>(^[a-zA-Z0-9_-]|^#[a-zA-Z0-9_-]|^##.+?$)</delimiter>
+ </licenseHeader>
+ </format>
+</formats>
+```
+
+Newly added file types need to be added in `include`
+
+And execute mvn spotless:check to verify
+
# Contributing
## Setup
For setting up the repo on IntelliJ, open the project and change the java
version to Java11 in File->ProjectStructure