diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index ce6dc82a..9ef22e86 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -5,3 +5,12 @@ additional_dependencies: [renovate@32.105.2] entry: renovate-config-validator files: '(^|/).?renovate(?:rc)?(?:\.json5?)?$' +- id: renovate-config-validator-iter + name: renovate-config-validator + description: Validate Renovate config + language: node + additional_dependencies: [renovate@32.105.2] + entry: bash -c 'for f in ${@:0}; do renovate-config-validator $f; done' + files: '(^|/).?renovate(?:rc)?(?:\.json5?)?$' + require_serial: true + pass_filenames: true diff --git a/README.md b/README.md index 7282d7f0..fdfd6a42 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,18 @@ repos: hooks: - id: renovate-config-validator ``` + +You can also use `renovate-config-validator-iter` in a project with multiple configurations by listing the configurations in the [files](https://pre-commit.com/#hooks-files) field + +```yaml +repos: + - repo: github.com/renovatebot/pre-commit-hooks + rev: 32.105.2 + hooks: + - id: renovate-config-validator + files: | + (?x)^( + (^|.*/).?renovate(?:rc)?(?:\.json5?)?$| + ^default\.json + ) +```