Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Revert "feat: implement custom.<customMgrName> syntax for matchManagers (#24112) #24125

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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);
}
}