Skip to content

Commit

Permalink
do not migrate language to matchLanguage
Browse files Browse the repository at this point in the history
  • Loading branch information
secustor committed Jul 1, 2023
1 parent 6abe789 commit 2e11610
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/config/migration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ describe('config/migration', () => {
packageRules: [
{
paths: ['package.json'],
languages: ['python'],
matchLanguages: ['python'],
baseBranchList: ['master'],
managers: ['dockerfile'],
datasources: ['orb'],
Expand Down
3 changes: 1 addition & 2 deletions lib/config/migrations/custom/package-rules-migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export const renameMap = {
matchFiles: 'matchFileNames',
matchPaths: 'matchFileNames',
paths: 'matchFileNames',
languages: 'matchLanguages',
baseBranchList: 'matchBaseBranches',
managers: 'matchManagers',
datasources: 'matchDatasources',
Expand All @@ -29,6 +28,7 @@ function renameKeys(packageRule: PackageRule): PackageRule {
function removeMatchLanguage(packageRule: PackageRule): PackageRule[] {
const newPackageRules: PackageRule[] = [];
const matchLanguages = packageRule.matchLanguages;
delete packageRule.matchLanguages;
// no migration needed
if (
is.nullOrUndefined(matchLanguages) ||
Expand All @@ -40,7 +40,6 @@ function removeMatchLanguage(packageRule: PackageRule): PackageRule[] {

// deep copy
const newRule: PackageRule = structuredClone(packageRule);
delete newRule.matchLanguages;

// are there any 1:1 migrateable languages
newRule.matchCategories = matchLanguages;
Expand Down

0 comments on commit 2e11610

Please sign in to comment.