forked from xoe-labs/coredns-ldap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
134 lines (132 loc) · 4.28 KB
/
.pre-commit-config.yaml
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
123
124
125
126
127
128
129
130
131
132
133
134
default_stages: [push, manual]
repos:
# ==========================================================================
# Golang Pre-Commit Hooks | https://github.com/tekwizely/pre-commit-golang
#
# Visit the project home page to learn more about the available Hooks,
# including useful arguments you might want to pass into them.
#
# File-Based Hooks:
# Run against matching staged files individually.
#
# Module-Based Hooks:
# Run against module root folders containing matching staged files.
#
# Package-Based Hooks:
# Run against folders containing one or more staged files.
#
# Repo-Based Hooks:
# Run against the entire repo.
# The hooks only run once (if any matching files are staged),
# and are NOT provided the list of staged files,
#
# Hook Suffixes
# Hooks have suffixes in their name that indicate their targets:
#
# +-----------+--------------+
# | Suffix | Target |
# |-----------+--------------+
# | <none> | Files |
# | -mod | Module |
# | -pkg | Package |
# | -repo-mod | All Modules |
# | -repo-pkg | All Packages |
# +-----------+--------------+
#
# ! Multiple Hook Invocations
# ! Due to OS command-line-length limits, Pre-Commit can invoke a hook
# ! multiple times if a large number of files are staged.
# ! For file and repo-based hooks, this isn't an issue, but for module
# ! and package-based hooks, there is a potential for the hook to run
# ! against the same module or package multiple times, duplicating any
# ! errors or warnings.
#
# Useful Hook Parameters:
# - id: hook-id
# args: [arg1, arg2, ..., '--'] # Pass options ('--' is optional)
# always_run: true # Run even if no matching files staged
# alias: hook-alias # Create an alias
#
# Passing Options To Hooks:
# If your options contain a reference to an existing file, then you will
# need to use a trailing '--' argument to separate the hook options from
# the modified-file list that Pre-Commit passes into the hook.
# NOTE: For repo-based hooks, '--' is not needed.
#
# Always Run:
# By default, hooks ONLY run when matching file types are staged.
# When configured to "always_run", a hook is executed as if EVERY matching
# file were staged.
#
# Aliases:
# Consider adding aliases to longer-named hooks for easier CLI usage.
# ==========================================================================
# - repo: https://github.com/tekwizely/pre-commit-golang
# rev: v0.8.0
- repo: https://github.com/blaggacao/pre-commit-golang
rev: fix-vendor
hooks:
#
# Go Build
#
# - id: go-build-mod
# - id: go-build-pkg
# - id: go-build-repo-mod
# - id: go-build-repo-pkg
#
# Go Test
#
- id: go-test-mod
- id: go-test-repo-mod
alias: go-test-repo-mod-all
always_run: true
stages: [manual]
# - id: go-test-pkg
# - id: go-test-repo-mod
# - id: go-test-repo-pkg
#
# Go Vet
#
# - id: go-vet
- id: go-vet-mod
alias: go-vet-mod-changed
# - id: go-vet-pkg
# - id: go-vet-repo-mod
# - id: go-vet-repo-pkg
#
# Formatters
#
# - id: go-fmt
# - id: go-imports # Replaces go-fmt
- id: go-returns # Replaces go-imports & go-fmt
- id: go-returns
alias: go-returns-write
stages: [manual]
args: [-w]
#
# Style Checkers
#
- id: go-lint
alias: go-lint-changed
# - id: go-critic
#
# GolangCI-Lint
# - Fast Multi-Linter
# - Can be configured to replace MOST other hooks
# - Supports repo config file for configuration
# - https://github.com/golangci/golangci-lint
#
# - id: golangci-lint
- id: golangci-lint-mod
alias: golangci-lint-mod-changed
- id: golangci-lint-repo-mod
alias: golangci-lint-repo-mod-all
always_run: true
stages: [manual]
# - id: golangci-lint-pkg
# - id: golangci-lint-repo-mod
# - id: golangci-lint-repo-pkg
- repo: https://github.com/prettier/prettier
rev: "2.0.5"
hooks:
- id: prettier