Open
Description
It seems like, if i use this tool with pre-commit, it tries to search Go files not in pre-commit .cache directory, but from root path of the repo. Could you please check with some empty git repo to use this pre-commit configuration to get same errors.
After creating .pre-commit-config.yaml and commiting files \ executing pre-commit run
repos:
- repo: https://github.com/hashicorp/copywrite
rev: v0.16.4
hooks:
- id: add-headers
- id: check-headers
have such error:
Add copyright headers....................................................Failed
- hook id: add-headers
- exit code: 1
go: cannot find main module, but found .git/config in /Users/gabenov/git/sandbox/pre-commit
to create a module there, run:
go mod init
or after executing go mod init pre-commit
Validate copyright headers...............................................Failed
- hook id: check-headers
- exit code: 1
no Go files in /Users/gabenov/git/sandbox/pre-commit
version: pre-commit 3.3.2