From 7d524dfd87ae3d815e25e55c65280683c4449d6c Mon Sep 17 00:00:00 2001 From: Florian Greinacher <florian.greinacher@siemens.com> Date: Mon, 5 Dec 2022 20:25:12 +0100 Subject: [PATCH] docs: clarify documentation for matchPaths (#19246) --- docs/usage/configuration-options.md | 31 ++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index c9a984516a..274c6243cb 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -1893,17 +1893,34 @@ Just like the earlier `matchPackagePatterns` example, the above will configure ` ### matchPaths -Renovate will match `matchPaths` against both a partial string match or a minimatch glob pattern. -If you want to avoid the partial string matching so that only glob matching is performed, wrap your string in `+(...)` like so: +Renovate finds the file(s) listed in `matchPaths` with a minimatch glob pattern. -``` - "matchPaths": ["+(package.json)"], +For example the following would match any `package.json`, including files like `backend/package.json`: + +```json +{ + "packageRules": [ + { + "description": "Group dependencies from package.json files", + "matchPaths": ["**/package.json"], + "groupName": "All package.json changes" + } + ] +} ``` -The above will match only the root `package.json`, whereas the following would match any `package.json` in any subdirectory too: +The following would match any file in directories starting with `app/`: -``` - "matchPaths": ["package.json"], +```json +{ + "packageRules": [ + { + "description": "Group all dependencies from the app directory", + "matchPaths": ["app/**"], + "groupName": "App dependencies" + } + ] +} ``` ### matchSourceUrlPrefixes -- GitLab