Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How exclude !Ref tag from check-yaml git hook?

There is a serverless.yaml file which contains line like that:

VpcId: !Ref MyVpc

Yaml files are validated by check-yaml git hook which invoked by pre-commit command. So the pre-commit run --all-files run is failed with error:

could not determine a constructor for the tag '!Ref'
  in "serverless.yml", line 172, column 29

Is there a way to configure check-yaml to skip this error?

like image 875
Cherry Avatar asked Dec 19 '19 16:12

Cherry


People also ask

How do you skip Precommit?

Quick tip if you want to skip the pre-commit validations and quickly want to get a commit out there. To get your commit through without running that pre-commit hook, use the --no-verify option. Voila, without pre-commit hooks running!

How do I disable Husky Precommit?

How do you turn off a husky hook? You can set HUSKY environment variable to 0 in your CI config file, to disable hooks installation.

What is core hooksPath?

The core. hooksPath config allows you to set a directory where the hooks are located for a repository. This is particularly useful if trying to commit your hooks to the repository (e.g. for sharing hooks with the team).


1 Answers

hooks:
- id: check-yaml
  args: ['--unsafe']

should do the trick. It just checks syntax instead of attempting to load the YAML.

like image 89
flyx Avatar answered Sep 26 '22 21:09

flyx