Skip to content

Commit 4eee5fe

Browse files
committed
fix(pre-commit): Hooks should use the copywrite binary
If you use copywrite in your repo, you probably already have copywrite installed. The hooks running `go run .` doesn't work in my terraform provider, because it is a plugin: ``` This binary is a plugin. These are not meant to be executed directly. Please execute the program that consumes these plugins, which will load any plugins automatically exit status 1 ``` So switch the entry point to be the copywrite program. Don't pass filenames. copywrite knows what to do. Pass arguments directly on the entry. Closes #78 Signed-off-by: Bryan Hundven <[email protected]>
1 parent 9d021bf commit 4eee5fe

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

.pre-commit-hooks.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
- id: add-headers
22
name: Add copyright headers
33
description: Adds missing copyright headers to all source code files
4-
entry: go run .
4+
entry: copywrite headers
55
language: golang
6-
args: [headers]
6+
pass_filenames: false
77

88
- id: check-headers
99
name: Validate copyright headers
1010
description: Checks if any copyright headers are missing, but does not make changes
11-
entry: go run .
11+
entry: copywrite headers --plan
1212
language: golang
13-
args: [headers --plan]
13+
pass_filenames: false
1414

1515
- id: add-license
1616
name: Add or fix repo license
1717
description: Adds or updates a non-compliant LICENSE file
18-
entry: go run .
18+
entry: copywrite license
1919
language: golang
20-
args: [license]
20+
pass_filenames: false
2121

2222
- id: check-license
2323
name: Validate repo license
2424
description: Checks if a LICENSE file is valid, but does not make changes
25-
entry: go run .
25+
entry: copywrite license --plan
2626
language: golang
27-
args: [license --plan]
27+
pass_filenames: false

0 commit comments

Comments
 (0)