This is an automated email from the ASF dual-hosted git repository.
xushiyan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hudi-rs.git
The following commit(s) were added to refs/heads/main by this push:
new 374a125 chore: add commit linting (#12)
374a125 is described below
commit 374a125db27893409d576608fdaccd7a97f70d9f
Author: Shiyan Xu <[email protected]>
AuthorDate: Sun May 5 15:12:44 2024 -0500
chore: add commit linting (#12)
Add github action job to enforce commit message conventional specified by
https://www.conventionalcommits.org/en/v1.0.0/
---
.commitlintrc.yaml | 46 ++++++++++++++++++++++++++++++++++++++++++++++
.github/workflows/pr.yml | 37 +++++++++++++++++++++++++++++++++++++
2 files changed, 83 insertions(+)
diff --git a/.commitlintrc.yaml b/.commitlintrc.yaml
new file mode 100644
index 0000000..20ffc70
--- /dev/null
+++ b/.commitlintrc.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.
+
+---
+# The rules below have been manually copied from
@commitlint/config-conventional
+# and match the v1.0.0 specification:
+# https://www.conventionalcommits.org/en/v1.0.0/#specification
+#
+# You can remove them and uncomment the config below when the following issue
is
+# fixed: https://github.com/conventional-changelog/commitlint/issues/613
+#
+# extends:
+# - '@commitlint/config-conventional'
+rules:
+ body-leading-blank: [1, always]
+ body-max-line-length: [2, always, 100]
+ footer-leading-blank: [1, always]
+ footer-max-line-length: [2, always, 100]
+ header-max-length: [2, always, 100]
+ subject-case:
+ - 2
+ - never
+ - [sentence-case, start-case, pascal-case, upper-case]
+ subject-empty: [2, never]
+ subject-full-stop: [2, never, "."]
+ type-case: [2, always, lower-case]
+ type-empty: [2, never]
+ type-enum:
+ - 2
+ - always
+ - [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test]
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
new file mode 100644
index 0000000..13f3c13
--- /dev/null
+++ b/.github/workflows/pr.yml
@@ -0,0 +1,37 @@
+# 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: PR
+
+on:
+ pull_request:
+ types: [ opened, edited, reopened, synchronize ]
+ branches:
+ - main
+
+jobs:
+ check_title:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ node-version: '20.x'
+ - name: Linting
+ run: |
+ npm i -g conventional-changelog-conventionalcommits
+ npm i -g commitlint@latest
+ echo ${{ github.event.pull_request.title }} | npx commitlint