Skip to content

Commit

Permalink
docs: add config-validation chapter (#21969)
Browse files Browse the repository at this point in the history
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
  • Loading branch information
fgreinacher and HonkingGoose committed May 9, 2023
1 parent 85631e8 commit ad78e85
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
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 @@
---
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.

```console
$ 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
5 changes: 5 additions & 0 deletions docs/usage/troubleshooting.md
Expand Up @@ -64,3 +64,8 @@ If none of these steps have helped you, then create a new discussion post to get
Please locate the relevant parts of the logs as described earlier before asking for help or posting a bug report.
Do not expect the Renovate maintainers to read through the full logs when trying to help you, as that takes a lot of time on our part.
If later it turns out that the full logs are necessary, you will be asked for them then.

## Validating configuration changes

Sometimes you will have to change your Renovate configuration to solve a problem.
The [`renovate-config-validator` program](config-validation.md) helps validate such configuration changes without commiting them to your repository.

0 comments on commit ad78e85

Please sign in to comment.