$ cat .pre-commit-config.yaml
- repo: https://github.com/zahorniak/pre-commit-circleci.git
rev: v1.1.0 # Ensure this is the latest tag, comparing to the Releases tab
hooks:
- id: circleci_validate
If you wish to pass additional args to circleci_validate, you can specify
them in the config. See circleci config validate --help
for accepted args.
You must use the form --arg=value
, not --arg value
.
For example, to set an org-slug:
$ cat .pre-commit-config.yaml
- repo: https://github.com/zahorniak/pre-commit-circleci.git
rev: v1.1.0 # Ensure this is the latest tag, comparing to the Releases tab
hooks:
- id: circleci_validate
args:
- --org-slug=my/organization
Or specify a custom config file:
$ cat .pre-commit-config.yaml
- repo: https://github.com/zahorniak/pre-commit-circleci.git
rev: v1.1.0 # Ensure this is the latest tag, comparing to the Releases tab
hooks:
- id: circleci_validate
args:
- .circleci/continue_config.yml
$ pre-commit install
pre-commit installed at .git/hooks/pre-commit
$ git commit -m "add circleci hook"
Validate CircleCI config.................................................Passed
[branchname 1111111] add circleci hook
1 file changed, 5 insertions(+), 1 deletion(-)
Hook | Description |
---|---|
circleci_validate |
Validates CircleCI configuration using command circleci config validate |
$ pre-commit run -a
Validate CircleCI config.................................................Passed