forked from agntcy/identity-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
110 lines (107 loc) · 3.09 KB
/
.pre-commit-config.yaml
File metadata and controls
110 lines (107 loc) · 3.09 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
# Copyright 2025 AGNTCY Contributors (https://github.com/agntcy)
# SPDX-License-Identifier: Apache-2.0
---
default_stages: [pre-commit, pre-push]
repos:
- repo: https://github.com/google/addlicense
rev: v1.2.0
hooks:
- id: addlicense # Add license header to files
args:
- -ignore
- '**/node_modules/**'
- -ignore
- '**/vendor/**'
- -ignore
- '**/.mockery.yaml'
- -c
- 'Copyright AGNTCY Contributors (https://github.com/agntcy)'
- -l
- Apache-2.0
- -s=only
files: \.(go|ts|tsx|js|jsx|py|sh|yaml|yml|css|scss)$
exclude: |
(?x)^(
sdk/python/(agntcy|google|openapiv3)/ # generated python proto bindings
|backend/api/spec/proto/ # .proto sources + generated (pb.go in same tree)
|backend/api/server/.*\.pb\.go$ # other generated Go protobufs
|backend/api/spec/static/api/openapi/ # generated openapi yaml
|docs/generatedSidebarsProtodocs.js # generated doc JS file
)
- repo: https://github.com/tekwizely/pre-commit-golang
rev: v1.0.0-rc.2
hooks:
- id: go-mod-tidy
files: |
(?x)(
^internal/|
^pkg/|
^cmd/
)
- id: go-fmt
files: |
(?x)(
^internal/|
^pkg/|
^cmd/
)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-added-large-files # Prevent giant files from being committed
files: |
(?x)(
^internal/|
^pkg/|
^cmd/
)
- id: detect-private-key # Checks for the existence of private keys
files: |
(?x)(
^internal/|
^pkg/|
^cmd/
)
- id: check-case-conflict # Check for files with names that would conflict on a case-insensitive filesystem
files: |
(?x)(
^internal/|
^pkg/|
^cmd/
)
- id: check-merge-conflict # Check for files that contain merge conflict strings
files: |
(?x)(
^internal/|
^pkg/|
^cmd/
)
- id: check-symlinks # Checks for symlinks which do not point to anything
files: |
(?x)(
^internal/|
^pkg/|
^cmd/
)
- id: end-of-file-fixer # Makes sure files end in a newline and only a newline
files: |
(?x)(
^internal/|
^pkg/|
^cmd/
)
- id: mixed-line-ending # Replaces or checks mixed line ending
files: |
(?x)(
^internal/|
^pkg/|
^cmd/
)
- id: trailing-whitespace # Trims trailing whitespace
files: |
(?x)(
^internal/|
^pkg/|
^cmd/
)
args: [--markdown-linebreak-ext=md]