diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index b57364434347c706b402a7a130d034a2819e14bf..6b46b8c499012eeceb082db725b66c143d6ba16c 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -1833,22 +1833,25 @@ For example, if you have an `examples` directory and you want all updates to tho } ``` -If you wish to limit Renovate to apply configuration rules to certain files in the root repository directory, you have to use `matchPaths` with either a partial string match or a minimatch pattern. +If you wish to limit Renovate to apply configuration rules to certain files in the root repository directory, you have to use `matchPaths` with a `minimatch` pattern or use [`matchFiles`](#matchfiles) with an exact match. For example you have multiple `package.json` and want to use `dependencyDashboardApproval` only on the root `package.json`: ```json { "packageRules": [ { - "matchPaths": ["+(package.json)"], + "matchFiles": ["package.json"], "dependencyDashboardApproval": true } ] } ``` -Important to know: Renovate will evaluate all `packageRules` and not stop once it gets a first match. -You should order your `packageRules` in ascending order of importance so that more important rules come later and can override settings from earlier rules if needed. +<!-- prettier-ignore --> +!!! tip + Renovate evaluates all `packageRules` and does not stop after the first match. + Order your `packageRules` so the least important rules are at the _top_, and the most important rules at the _bottom_. + This way important rules override settings from earlier rules if needed. <!-- prettier-ignore --> !!! warning @@ -2138,11 +2141,17 @@ Renovate will compare `matchFiles` for an exact match against the dependency's p For example the following would match `package.json` but not `package/frontend/package.json`: -``` - "matchFiles": ["package.json"], +```json +{ + "packageRules": [ + { + "matchFiles": ["package.json"] + } + ] +} ``` -Use `matchPaths` instead if you need more flexible matching. +Use [`matchPaths`](#matchpaths) instead if you need more flexible matching. ### matchDepNames @@ -2204,9 +2213,9 @@ Just like the earlier `matchPackagePatterns` example, the above will configure ` ### matchPaths -Renovate finds the file(s) listed in `matchPaths` with a minimatch glob pattern. +Renovate finds the file(s) listed in `matchPaths` with a `minimatch` glob pattern. -For example the following would match any `package.json`, including files like `backend/package.json`: +For example the following matches any `package.json`, including files like `backend/package.json`: ```json { @@ -2220,7 +2229,7 @@ For example the following would match any `package.json`, including files like ` } ``` -The following would match any file in directories starting with `app/`: +The following matches any file in directories starting with `app/`: ```json { @@ -2234,6 +2243,11 @@ The following would match any file in directories starting with `app/`: } ``` +<!-- prettier-ignore --> +!!! warning + Partial matches for `matchPaths` are deprecated. + Please use a `minimatch` glob pattern or switch to [`matchFiles`](#matchfiles) if you need exact matching. + ### matchSourceUrlPrefixes Here's an example of where you use this to group together all packages from the `renovatebot` GitHub org: