bug: pre-commit complains about missing BurntSushi/[email protected] go.sum entry
Describe the bug I use pre-commit to run tfsec linter. I upgraded the tfsec version from v0.58.6 to v1.26.0, and got the following error message:
Traceback (most recent call last):
File "/Users/x/Library/Python/3.8/lib/python/site-packages/pre_commit/error_handler.py", line 73, in error_handler
yield
File "/Users/x/Library/Python/3.8/lib/python/site-packages/pre_commit/main.py", line 389, in main
return run(args.config, store, args)
File "/Users/x/Library/Python/3.8/lib/python/site-packages/pre_commit/commands/run.py", line 414, in run
install_hook_envs(to_install, store)
File "/Users/x/Library/Python/3.8/lib/python/site-packages/pre_commit/repository.py", line 223, in install_hook_envs
_hook_install(hook)
File "/Users/x/Library/Python/3.8/lib/python/site-packages/pre_commit/repository.py", line 79, in _hook_install
lang.install_environment(
File "/Users/x/Library/Python/3.8/lib/python/site-packages/pre_commit/languages/golang.py", line 83, in install_environment
cmd_output_b('go', 'install', './...', cwd=repo_src_dir, env=env)
File "/Users/x/Library/Python/3.8/lib/python/site-packages/pre_commit/util.py", line 146, in cmd_output_b
raise CalledProcessError(returncode, cmd, retcode, stdout_b, stderr_b)
pre_commit.util.CalledProcessError: command: ('/usr/local/go/bin/go', 'install', './...')
return code: 1
expected return code: 0
stdout: (none)
stderr:
go: github.com/aquasecurity/[email protected] requires
github.com/BurntSushi/[email protected]: missing go.sum entry; to add it:
go mod download github.com/BurntSushi/toml
To Reproduce Steps to reproduce the behavior:
# set up demo repo
cd /tmp
mkdir tfsec_demo
cd tfsec_demo
git init
# install pre-commit
pip install pre-commit
# configure pre-commit
echo 'default_language_version:
python: python3.8
repos:
- repo: https://github.com/aquasecurity/tfsec
rev: v1.26.0
hooks:
- id: tfsec
entry: tfsec IAC/
args: [ "--tfvars-file=IAC/vars/terraform.tfvars" ]
pass_filenames: false' >.pre-commit-config.yaml
# run tfsec linter through pre-commit
pre-commit run --all-files
System Info
- tfsec version:
v1.26.0 - OS:
macos 12.2 - python:
3.8 - pre-commit:
pre-commit 2.19.0
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This may be an issue with precommit - what version of Go are you using to build tfsec?
Hi @liamg,
I am using Go version 1.16.3
Please could you try with 1.19? If there is still an issue we can dive a bit deeper.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.