Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(validator): Recommend npx to run validator #26628

Merged
merged 3 commits into from
Feb 18, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions docs/usage/config-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,29 @@ When you run `renovate-config-validator` with no arguments it will check:
For example:

```console
$ npm install --global renovate
added 750 packages, and audited 751 packages in 51s
$ renovate-config-validator
$ npx --yes --package renovate -- renovate-config-validator
INFO: Validating renovate.json
INFO: Config validated successfully
```

### Strict mode

By default, the validator program fails with a non-zero exit code if there are any validation warnings or errors.
You can pass the `--strict` flag to make it fail if a scanned config needs migration.
You can pass the `--strict` flag to make it fail if a scanned config needs migration:
TWiStErRob marked this conversation as resolved.
Show resolved Hide resolved

```console
rarkins marked this conversation as resolved.
Show resolved Hide resolved
$ npx --yes --package renovate -- renovate-config-validator --strict
INFO: Validating renovate.json
WARN: Config migration necessary
"oldConfig": {
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [ "config:base" ]
},
"newConfig": {
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [ "config:recommended" ]
},
```

### Pass file to check as CLI arguments

Expand All @@ -37,9 +49,7 @@ This can be handy to check a config file with a non-default name, like when you'
For example:

```console
$ npm install --global renovate
added 750 packages, and audited 751 packages in 51s
$ renovate-config-validator first_config.json
$ npx --yes --package renovate -- renovate-config-validator first_config.json
INFO: Validating first_config_.json
INFO: Config validated successfully
```
Expand Down