Che*_*rry 5 python git yaml pre-commit-hook
有一个serverless.yaml文件包含这样的行:
VpcId: !Ref MyVpc
Run Code Online (Sandbox Code Playgroud)
Yaml 文件check-yaml git由pre-commit命令调用的钩子验证。所以pre-commit run --all-files运行失败并出现错误:
could not determine a constructor for the tag '!Ref'
in "serverless.yml", line 172, column 29
Run Code Online (Sandbox Code Playgroud)
有没有办法配置check-yaml跳过这个错误?
hooks:
- id: check-yaml
args: ['--unsafe']
Run Code Online (Sandbox Code Playgroud)
应该做的伎俩。它只是检查语法而不是尝试加载 YAML。