Closed declan-morris closed 1 year ago
Same repo, +- same conditions (could vary up to +-20seconds)
TFLint version 0.41.0: 3m 10s TFLint version 0.42.0: 7m 41s TFLint version 0.42.1: 8m 46s TFLint version 0.42.2: 8m 32s TFLint version 0.43.0: 7m 37s TFLint version 0.44.0: 2m 48s TFLint version 0.44.1: 2m 53s
Resolution: Just do not use TFLint version between 0.42.0
and 0.43.0
because they have performance issues
Describe the bug
Latest version of Tflint hangs when running pre-commit. Left for over an hour and it can only be cancelled with a
CTRL+C
. I've installed a previously working version (v0.41.0) and it works fine.For anyone else experiencing this issue, the below works correctly.
How can we reproduce it?
Download latest tflint as of this bug report that's v0.43.0 and does not work with pre-commit. Running tflint manually via the cli on a folder with terraform files does work so it appears it's just pre-commit and tflint issue rather than a tflint issue?
Result is that it hangs on and does not output anything
Logs
```bash version information `` pre-commit version: 2.20.0 git --version: git version 2.25.1 sys.version: 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0] sys.executable: /usr/bin/python3 os.name: posix sys.platform: linux `` ### error information `` Interrupted (^C): KeyboardInterrupt: `` `` Traceback (most recent call last): File "/home/dtm/.local/lib/python3.8/site-packages/pre_commit/error_handler.py", line 73, in error_handler yield File "/home/dtm/.local/lib/python3.8/site-packages/pre_commit/main.py", line 386, in main return run(args.config, store, args) File "/home/dtm/.local/lib/python3.8/site-packages/pre_commit/commands/run.py", line 426, in run return _run_hooks(config, hooks, skips, args) File "/home/dtm/.local/lib/python3.8/site-packages/pre_commit/commands/run.py", line 285, in _run_hooks current_retval, prior_diff = _run_single_hook( File "/home/dtm/.local/lib/python3.8/site-packages/pre_commit/commands/run.py", line 192, in _run_single_hook retcode, out = language.run_hook(hook, filenames, use_color) File "/home/dtm/.local/lib/python3.8/site-packages/pre_commit/languages/script.py", line 20, in run_hook return helpers.run_xargs(hook, cmd, file_args, color=color) File "/home/dtm/.local/lib/python3.8/site-packages/pre_commit/languages/helpers.py", line 134, in run_xargs return xargs(cmd, file_args, **kwargs) File "/home/dtm/.local/lib/python3.8/site-packages/pre_commit/xargs.py", line 164, in xargs for proc_retcode, proc_out, _ in results: File "/home/dtm/.local/lib/python3.8/site-packages/pre_commit/xargs.py", line 156, in run_cmd_partition return cmd_fn( File "/home/dtm/.local/lib/python3.8/site-packages/pre_commit/util.py", line 224, in cmd_output_p bts = os.read(pty.r, 4096) KeyboardInterrupt `` ```Environment information
OS: Win10 with Ubuntu 20.04 on WSL2
uname -a
output:.pre-commit-config.yaml
:file content
```bash - repo: https://github.com/antonbabenko/pre-commit-terraform rev: v1.76.0 hooks: - id: terraform_fmt - id: terraform_docs files: 'modules/.*' args: - --hook-config=--path-to-file=README.md - --hook-config=--add-to-existing-file=true - --hook-config=--create-file-if-not-exist=true - id: terraform_tflint args: - --args=--enable-rule=terraform_documented_variables - --args=--enable-rule=terraform_documented_outputs - id: terraform_checkov ```