Python 怎么排除!检查yaml git挂钩的参考标签?
有一个Python 怎么排除!检查yaml git挂钩的参考标签?,python,git,yaml,pre-commit-hook,Python,Git,Yaml,Pre Commit Hook,有一个serverless.yaml文件,其中包含如下行: VpcId: !Ref MyVpc Yaml文件由check Yamlgit钩子验证,钩子由pre-commit命令调用。因此,预提交运行--all files运行失败,出现错误: could not determine a constructor for the tag '!Ref' in "serverless.yml", line 172, column 29 是否有办法配置检查yaml跳过此错误 hooks: - id:
serverless.yaml
文件,其中包含如下行:
VpcId: !Ref MyVpc
Yaml文件由check Yaml
git
钩子验证,钩子由pre-commit
命令调用。因此,预提交运行--all files
运行失败,出现错误:
could not determine a constructor for the tag '!Ref'
in "serverless.yml", line 172, column 29
是否有办法配置检查yaml
跳过此错误
hooks:
- id: check-yaml
args: ['--unsafe']
我们应该做到这一点。它只是检查语法,而不是试图加载YAML。在上面的具体示例中,这表明云形成模板,您也可以考虑。这是可行的,但是,使用此选项,代码>将所有可移植性的保证全部移除到其他YAML实现< /COD>。