Skip to content

Commit

Permalink
fix: Revert "feat: implement custom.<customMgrName> syntax for `mat…
Browse files Browse the repository at this point in the history
…chManagers` (#24112) (#24125)
  • Loading branch information
rarkins committed Aug 28, 2023
1 parent 0578cdc commit 30359ac
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 63 deletions.
26 changes: 0 additions & 26 deletions lib/config/migrations/custom/match-managers-migration.spec.ts

This file was deleted.

18 changes: 0 additions & 18 deletions lib/config/migrations/custom/match-managers-migration.ts

This file was deleted.

2 changes: 1 addition & 1 deletion lib/config/validation-helpers/managers.spec.ts
Expand Up @@ -3,7 +3,7 @@ import { check } from './managers';
describe('config/validation-helpers/managers', () => {
it('should have no errors', () => {
const res = check({
resolvedRule: { matchManagers: ['npm', 'regex', 'custom.regex'] },
resolvedRule: { matchManagers: ['npm', 'regex'] },
currentPath: '',
});
expect(res).toEqual([]);
Expand Down
3 changes: 1 addition & 2 deletions lib/config/validation-helpers/managers.ts
Expand Up @@ -13,8 +13,7 @@ export function check({
if (Array.isArray(resolvedRule.matchManagers)) {
if (
resolvedRule.matchManagers.find(
(confManager) =>
!allManagersList.includes(confManager.replace('custom.', ''))
(confManager) => !allManagersList.includes(confManager)
)
) {
managersErrMessage = `${currentPath}:
Expand Down
12 changes: 0 additions & 12 deletions lib/util/package-rules/managers.spec.ts
Expand Up @@ -47,17 +47,5 @@ describe('util/package-rules/managers', () => {
);
expect(result).toBeFalse();
});

it('should match custom managers', () => {
const result = managersMatcher.matches(
{
manager: 'regex',
},
{
matchManagers: ['custom.regex'],
}
);
expect(result).toBeTrue();
});
});
});
4 changes: 0 additions & 4 deletions lib/util/package-rules/managers.ts
@@ -1,6 +1,5 @@
import is from '@sindresorhus/is';
import type { PackageRule, PackageRuleInputConfig } from '../../config/types';
import { isCustomManager } from '../../modules/manager/custom';
import { Matcher } from './base';

export class ManagersMatcher extends Matcher {
Expand All @@ -14,9 +13,6 @@ export class ManagersMatcher extends Matcher {
if (is.undefined(manager) || !manager) {
return false;
}
if (isCustomManager(manager)) {
return matchManagers.includes(`custom.${manager}`);
}
return matchManagers.includes(manager);
}
}

0 comments on commit 30359ac

Please sign in to comment.