-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
122 lines (122 loc) · 4.41 KB
/
.pre-commit-config.yaml
File metadata and controls
122 lines (122 loc) · 4.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#
# 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.
#
---
default_stages: [pre-commit]
default_language_version:
python: python3
minimum_pre_commit_version: '3.2.0'
repos:
- repo: local
hooks:
- id: sort-actions-yml
name: Sort actions.yml
entry: ./scripts/sort_yml.py
language: python
additional_dependencies: ['rich>=12.4.4', 'ruamel.yaml']
require_serial: true
files: ^actions\.yml$
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: ad1b27d73581aa16cca06fc4a0761fc563ffe8e8 # frozen: v1.5.6
hooks:
# Files in stash/ (except stash/pyproject.toml) carry the short-form
# Apache 2.0 license ("Copyright (c) The stash contributors / Licensed
# under the Apache License, Version 2.0") which RAT accepts. Adding the
# full ASF contributor header on top would just duplicate, so they are
# excluded across every ecosystem-specific hook below.
- id: insert-license
name: Add Apache license header to Python files
files: \.py$
exclude: ^stash/(?!pyproject\.toml).*$
args:
- --comment-style
- "#|#|#"
- --license-filepath
- license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
- id: insert-license
name: Add Apache license header to YAML files
files: \.ya?ml$
# approved_patterns.yml is regenerated from actions.yml by gateway/.
# stash-action-test.yml uses the short-form Apache 2.0 license to
# match the rest of the stash sub-project.
exclude: |
(?x)
^approved_patterns\.yml$|
^stash/(?!pyproject\.toml).*$|
^\.github/workflows/stash-action-test\.yml$
args:
- --comment-style
- "#|#|#"
- --license-filepath
- license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
- id: insert-license
name: Add Apache license header to TOML files
files: \.toml$
args:
- --comment-style
- "#|#|#"
- --license-filepath
- license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
- id: insert-license
name: Add Apache license header to shell scripts
files: \.(sh|bash)$
args:
- --comment-style
- "#|#|#"
- --license-filepath
- license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
- id: insert-license
name: Add Apache license header to Dockerfiles
files: (^|/)Dockerfile$|\.Dockerfile$
args:
- --comment-style
- "#|#|#"
- --license-filepath
- license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
- id: insert-license
name: Add Apache license header to ezt templates
files: \.ezt$
args:
- --comment-style
- "#|#|#"
- --license-filepath
- license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
- id: insert-license
name: Add Apache license header to Markdown files
files: \.md$
# CLAUDE.md / AGENTS.md are agentic-tooling docs that follow the
# short-license convention used in apache/airflow; keeping them
# exempted here matches that convention until we add the short
# template too. stash/README.md uses the short-form Apache license.
exclude: |
(?x)
^(?:.*/)?AGENTS\.md$|
^(?:.*/)?CLAUDE\.md$|
^stash/.*\.md$
args:
- --comment-style
- "<!--| |-->"
- --license-filepath
- license-templates/LICENSE.txt
- --fuzzy-match-generates-todo