This is an automated email from the ASF dual-hosted git repository.

sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-actions.git


The following commit(s) were added to refs/heads/main by this push:
     new 7c96239  Add a lint to add the Apache-2.0 license header
7c96239 is described below

commit 7c962391703a60f028a30cf2bc1d2b0699d46314
Author: Sean B. Palmer <[email protected]>
AuthorDate: Fri Aug 22 15:22:08 2025 +0100

    Add a lint to add the Apache-2.0 license header
---
 .pre-commit-config.yaml     | 29 +++++++++++++++++++++++++++++
 .yamllint.yaml              | 17 +++++++++++++++++
 share/apache-2.0_header.txt | 16 ++++++++++++++++
 3 files changed, 62 insertions(+)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index a0344bc..67c73d6 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,3 +1,20 @@
+# 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.
+
 exclude: >
   ^(
     \.git/|
@@ -27,6 +44,18 @@ repos:
       - id: name-tests-test
       - id: trailing-whitespace
 
+  - repo: https://github.com/Lucas-C/pre-commit-hooks
+    rev: v1.5.5
+    hooks:
+      - id: insert-license
+        name: Add license header to all YAML files
+        files: ^.*\.ya?ml$
+        args:
+          - --comment-style
+          - "|#|"
+          - --license-filepath
+          - share/apache-2.0_header.txt
+
   - repo: https://github.com/adrienverge/yamllint
     rev: v1.37.1
     hooks:
diff --git a/.yamllint.yaml b/.yamllint.yaml
index d70a98a..62d295b 100644
--- a/.yamllint.yaml
+++ b/.yamllint.yaml
@@ -1,3 +1,20 @@
+# 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.
+
 extends: default
 
 rules:
diff --git a/share/apache-2.0_header.txt b/share/apache-2.0_header.txt
new file mode 100644
index 0000000..60b675e
--- /dev/null
+++ b/share/apache-2.0_header.txt
@@ -0,0 +1,16 @@
+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.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to