尝试在 Windows 上启动并运行预提交,尝试一个简单的 terraform fmt 命令,但没有很多如何运行 exe 的示例,我有以下内容:
我的.pre-commit-config.yaml
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0 # Use the ref you want to point at
hooks:
- id: detect-aws-credentials
- id: detect-private-key
- repo: local
hooks:
- id: terraform-fmt
name: terraform fmt
description: runs terraform fmt
entry: terraform fmt
args: [-recursive]
language: system
但我从以下错误中得到pre-commit run -a
:
Detect AWS Credentials...................................................Passed
Detect Private Key.......................................................Passed
terraform fmt............................................................Failed
- hook id: terraform-fmt
- exit code: 1
The fmt command expects at most one argument.
Usage: terraform fmt [options] [DIR]
然后它看起来像它多次运行 terraform fmt,因为我不断在循环中收到错误。知道我缺少什么吗?