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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add config-validation chapter #21969

Merged
merged 11 commits into from May 9, 2023
1 change: 1 addition & 0 deletions docs/usage/.pages
Expand Up @@ -6,6 +6,7 @@ nav:
- 'Self-hosted': 'self-hosted-configuration.md'
- 'Repository': 'configuration-options.md'
- 'Presets': 'config-presets.md'
- 'Validation': 'config-validation.md'
- ... | key-concepts
- ... | modules
- Language Support:
Expand Down
22 changes: 22 additions & 0 deletions docs/usage/config-validation.md
@@ -0,0 +1,22 @@
---
rarkins marked this conversation as resolved.
Show resolved Hide resolved
title: Config Validation
description: How to validate Renovate's configuration.
---

# Config Validation

All [`renovate` distributions](getting-started/running.md#available-distributions) contain a standalone validator program (`renovate-config-validator`) that can be used to validate Renovate's configuration.

The validator program checks files passed as CLI arguments.
If no argument is given, all [default locations](configuration-options.md) (if files exist) and the `RENOVATE_CONFIG_FILE` environment variable are checked.

```shell-session
fgreinacher marked this conversation as resolved.
Show resolved Hide resolved
$ npm install --global renovate
added 750 packages, and audited 751 packages in 51s
$ renovate-config-validator
INFO: Validating renovate.json
INFO: Config validated successfully
```

You can configure a [pre-commit](https://pre-commit.com) hook to validate your configuration automatically.
Please check out the [`renovatebot/pre-commit-hooks` repository](https://github.com/renovatebot/pre-commit-hooks) for more information.
8 changes: 1 addition & 7 deletions docs/usage/getting-started/installing-onboarding.md
Expand Up @@ -133,15 +133,9 @@ If you want to make config edits directly, follow these steps:
1. Create a new Git branch to work on
1. Install or update the `renovate` package globally (`npm i -g renovate` or `yarn global add renovate`) to get the `renovate-config-validator` program
1. Edit your Renovate configuration file
1. Validate your config by running `renovate-config-validator`
1. [Validate your config](../config-validation.md)
1. If the improved config passes the validation, merge the branch into your mainline branch

The validator program checks files passed as CLI arguments.
If no argument is given, all [default locations](../configuration-options.md) (if files exist) and the `RENOVATE_CONFIG_FILE` environment variable are checked.

You can configure a [pre-commit](https://pre-commit.com) hook to validate your configuration automatically.
Please check out the [`renovatebot/pre-commit-hooks` repository](https://github.com/renovatebot/pre-commit-hooks) for more information.

### Nuke config and re-onboard

Perhaps you really liked the interactive onboarding PR and want to use it again.
Expand Down