|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
1 | 18 | # pre-commit hooks require a user to have installed `prek`: |
2 | 19 | # $ brew install prek |
3 | 20 | # Then install the hooks within the repo: |
@@ -25,6 +42,78 @@ repos: |
25 | 42 | - id: requirements-txt-fixer |
26 | 43 | # valid python file |
27 | 44 | - id: check-ast |
| 45 | + - repo: https://github.com/Lucas-C/pre-commit-hooks |
| 46 | + rev: v1.5.6 |
| 47 | + hooks: |
| 48 | + - id: insert-license |
| 49 | + name: Add license for all Python files |
| 50 | + files: \.py$|\.pyi$ |
| 51 | + exclude: ^\.github/ |
| 52 | + args: |
| 53 | + - --comment-style |
| 54 | + - "|#|" |
| 55 | + - --license-filepath |
| 56 | + - scripts/ci/license-templates/LICENSE |
| 57 | + - --fuzzy-match-generates-todo |
| 58 | + - id: insert-license |
| 59 | + name: Add license for all YAML files |
| 60 | + files: \.ya?ml$ |
| 61 | + types: [yaml] |
| 62 | + exclude: ^\.github/ |
| 63 | + args: |
| 64 | + - --comment-style |
| 65 | + - "|#|" |
| 66 | + - --license-filepath |
| 67 | + - scripts/ci/license-templates/LICENSE |
| 68 | + - --fuzzy-match-generates-todo |
| 69 | + - id: insert-license |
| 70 | + name: Add license for all TOML files |
| 71 | + files: \.toml$ |
| 72 | + exclude: ^\.github/ |
| 73 | + args: |
| 74 | + - --comment-style |
| 75 | + - "|#|" |
| 76 | + - --license-filepath |
| 77 | + - scripts/ci/license-templates/LICENSE |
| 78 | + - --fuzzy-match-generates-todo |
| 79 | + - id: insert-license |
| 80 | + name: Add license for all Shell files |
| 81 | + files: \.bash$|\.sh$ |
| 82 | + exclude: ^\.github/ |
| 83 | + args: |
| 84 | + - --comment-style |
| 85 | + - "|#|" |
| 86 | + - --license-filepath |
| 87 | + - scripts/ci/license-templates/LICENSE |
| 88 | + - --fuzzy-match-generates-todo |
| 89 | + - id: insert-license |
| 90 | + name: Add license for all Markdown files |
| 91 | + files: \.md$ |
| 92 | + exclude: | |
| 93 | + (?x) |
| 94 | + ^\.github/.*\.md$| |
| 95 | + ^scripts/ci/license-templates/ |
| 96 | + args: |
| 97 | + - --comment-style |
| 98 | + - "<!--|| -->" |
| 99 | + - --license-filepath |
| 100 | + - scripts/ci/license-templates/LICENSE |
| 101 | + - --fuzzy-match-generates-todo |
| 102 | + - id: insert-license |
| 103 | + name: Add short license for agentic Markdown files |
| 104 | + files: | |
| 105 | + (?x) |
| 106 | + ^\.github/.*\.md$ |
| 107 | + exclude: | |
| 108 | + (?x) |
| 109 | + ^\.github/ISSUE_TEMPLATE/| |
| 110 | + ^scripts/ci/license-templates/ |
| 111 | + args: |
| 112 | + - --comment-style |
| 113 | + - "||" |
| 114 | + - --license-filepath |
| 115 | + - scripts/ci/license-templates/SHORT_LICENSE.md |
| 116 | + - --fuzzy-match-generates-todo |
28 | 117 | - repo: local |
29 | 118 | hooks: |
30 | 119 | - id: validate-example-notebooks |
|
0 commit comments