mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
feat(repo): validation rules for lefthook
This commit is contained in:
@@ -1,6 +1,25 @@
|
|||||||
---
|
---
|
||||||
# assert_lefthook_installed: true
|
assert_lefthook_installed: true
|
||||||
no_tty: true
|
no_tty: true
|
||||||
|
skip_output:
|
||||||
|
- meta
|
||||||
|
- skips
|
||||||
|
- execution_out
|
||||||
|
|
||||||
|
validate:
|
||||||
|
parallel: true
|
||||||
|
commands:
|
||||||
|
json: &jq
|
||||||
|
# No official docker image available for now, falling back to the local
|
||||||
|
# command.
|
||||||
|
glob: "*.json"
|
||||||
|
run: jq -c '.' {all_files}
|
||||||
|
yaml: &yq
|
||||||
|
# Python's one, not mikefarah's.
|
||||||
|
# No official docker image available for now, falling back to the local
|
||||||
|
# command.
|
||||||
|
glob: "*.{yaml,yml}"
|
||||||
|
run: yq -c '.' {all_files}
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
parallel: true
|
parallel: true
|
||||||
@@ -20,10 +39,16 @@ lint:
|
|||||||
pre-commit:
|
pre-commit:
|
||||||
parallel: true
|
parallel: true
|
||||||
commands:
|
commands:
|
||||||
hadolint:
|
validate-json:
|
||||||
|
<<: *jq
|
||||||
|
run: jq -c '.' {staged_files}
|
||||||
|
validate-yaml:
|
||||||
|
<<: *yq
|
||||||
|
run: yq -c '.' {staged_files}
|
||||||
|
lint-docker:
|
||||||
<<: *hadolint
|
<<: *hadolint
|
||||||
run: hadolint {staged_files}
|
run: hadolint {staged_files}
|
||||||
yamllint:
|
lint-yaml:
|
||||||
<<: *yamllint
|
<<: *yamllint
|
||||||
run: >-
|
run: >-
|
||||||
docker run --rm -v "$PWD:/code" 'registry.gitlab.com/pipeline-components/yamllint:latest'
|
docker run --rm -v "$PWD:/code" 'registry.gitlab.com/pipeline-components/yamllint:latest'
|
||||||
@@ -34,4 +59,4 @@ commit-msg:
|
|||||||
commitlint:
|
commitlint:
|
||||||
# No official docker image available for now, falling back to the local
|
# No official docker image available for now, falling back to the local
|
||||||
# command.
|
# command.
|
||||||
run: commitlint --edit
|
run: commitlint -c '.commitlintrc.js' --edit
|
||||||
|
|||||||
Reference in New Issue
Block a user