diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 7b8fe488db7364..dccc8588244373 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -2295,11 +2295,6 @@ The following matches any file in directories starting with `app/`: } ``` - -!!! 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: diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index e0f79c2714730d..ee52b5669813cc 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -1307,7 +1307,7 @@ const options: RenovateOptions[] = [ { name: 'matchPaths', description: - 'List of strings or glob patterns to match against package files. Only works inside a `packageRules` object.', + 'List of glob patterns to match against package files. Only works inside a `packageRules` object.', type: 'array', subType: 'string', stage: 'repository', diff --git a/lib/util/package-rules/index.spec.ts b/lib/util/package-rules/index.spec.ts index 9e6f48f4b38d11..ecfeee4914794c 100644 --- a/lib/util/package-rules/index.spec.ts +++ b/lib/util/package-rules/index.spec.ts @@ -989,7 +989,7 @@ describe('util/package-rules/index', () => { ...config, depName: 'test', }); - expect(res3.x).toBeDefined(); + expect(res3.x).toBeUndefined(); }); it('empty rules', () => { diff --git a/lib/util/package-rules/paths.spec.ts b/lib/util/package-rules/paths.spec.ts index 9b0c1db55484aa..4e0bfed3567995 100644 --- a/lib/util/package-rules/paths.spec.ts +++ b/lib/util/package-rules/paths.spec.ts @@ -17,7 +17,7 @@ describe('util/package-rules/paths', () => { expect(result).toBeFalse(); }); - it('should return true and log warning on partial match only', () => { + it('should return false on partial match only', () => { const result = pathsMatcher.matches( { packageFile: 'opentelemetry/http/package.json', @@ -26,14 +26,7 @@ describe('util/package-rules/paths', () => { matchPaths: ['opentelemetry/http'], } ); - expect(result).toBeTrue(); - expect(logger.warn).toHaveBeenCalledWith( - { - packageFile: 'opentelemetry/http/package.json', - rulePath: 'opentelemetry/http', - }, - 'Partial matches for `matchPaths` are deprecated. Please use a minimatch glob pattern or switch to `matchFiles` if you need exact matching.' - ); + expect(result).toBeFalse(); }); it('should return true and not log warning on partial and glob match', () => { diff --git a/lib/util/package-rules/paths.ts b/lib/util/package-rules/paths.ts index 7bd882c56966e0..7fa70aaa9ef991 100644 --- a/lib/util/package-rules/paths.ts +++ b/lib/util/package-rules/paths.ts @@ -1,7 +1,6 @@ import is from '@sindresorhus/is'; import { minimatch } from 'minimatch'; import type { PackageRule, PackageRuleInputConfig } from '../../config/types'; -import { logger } from '../../logger'; import { Matcher } from './base'; export class PathsMatcher extends Matcher { @@ -16,21 +15,8 @@ export class PathsMatcher extends Matcher { return false; } - return matchPaths.some((rulePath) => { - if (minimatch(packageFile, rulePath, { dot: true })) { - return true; - } - - if (packageFile.includes(rulePath)) { - logger.warn( - { - rulePath, - packageFile, - }, - 'Partial matches for `matchPaths` are deprecated. Please use a minimatch glob pattern or switch to `matchFiles` if you need exact matching.' - ); - return true; - } - }); + return matchPaths.some((rulePath) => + minimatch(packageFile, rulePath, { dot: true }) + ); } }