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

Update dependency prettier to v3 #390

Merged
merged 4 commits into from
Feb 15, 2025
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ repos:
rev: v1.2.0
hooks:
- id: helm-docs
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v2.7.1" # Use the sha or tag you want to point at
- repo: https://github.com/rbubley/mirrors-prettier
rev: "v3.5.1" # Use the sha or tag you want to point at
hooks:
- id: prettier
4 changes: 2 additions & 2 deletions app/command-enabled.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function labelEnabled(config, labels) {
return {
enabled: false,
error: `${labels} doesn't match the allowed labels \`${labelConfig.allowedLabels.join(
","
",",
)}\``,
};
}
Expand Down Expand Up @@ -70,7 +70,7 @@ export function removeLabelEnabled(config, labels) {
return {
enabled: false,
error: `${labels} doesn't match the allowed labels \`${labelConfig.allowedLabels.join(
","
",",
)}\``,
};
}
Expand Down
24 changes: 12 additions & 12 deletions app/command-enabled.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe("command-enabled", () => {
},
},
},
["label1"]
["label1"],
);

expect(sut.enabled).toEqual(true);
Expand All @@ -59,7 +59,7 @@ describe("command-enabled", () => {
},
},
},
["label1"]
["label1"],
);

expect(sut.enabled).toEqual(false);
Expand All @@ -75,7 +75,7 @@ describe("command-enabled", () => {
},
},
},
["label1"]
["label1"],
);

expect(sut.enabled).toEqual(true);
Expand All @@ -90,7 +90,7 @@ describe("command-enabled", () => {
},
},
},
["label4"]
["label4"],
);

expect(sut.enabled).toEqual(false);
Expand All @@ -105,7 +105,7 @@ describe("command-enabled", () => {
},
},
},
["label3", "label1", "label2"]
["label3", "label1", "label2"],
);

expect(sut.enabled).toEqual(true);
Expand All @@ -120,7 +120,7 @@ describe("command-enabled", () => {
},
},
},
["label2", "label1", "label5"]
["label2", "label1", "label5"],
);

expect(sut.enabled).toEqual(false);
Expand Down Expand Up @@ -187,7 +187,7 @@ describe("command-enabled", () => {
},
},
},
["label1"]
["label1"],
);

expect(sut.enabled).toEqual(true);
Expand All @@ -202,7 +202,7 @@ describe("command-enabled", () => {
},
},
},
["label1"]
["label1"],
);

expect(sut.enabled).toEqual(false);
Expand All @@ -218,7 +218,7 @@ describe("command-enabled", () => {
},
},
},
["label1"]
["label1"],
);

expect(sut.enabled).toEqual(true);
Expand All @@ -233,7 +233,7 @@ describe("command-enabled", () => {
},
},
},
["label4"]
["label4"],
);

expect(sut.enabled).toEqual(false);
Expand All @@ -248,7 +248,7 @@ describe("command-enabled", () => {
},
},
},
["label3", "label1", "label2"]
["label3", "label1", "label2"],
);

expect(sut.enabled).toEqual(true);
Expand All @@ -263,7 +263,7 @@ describe("command-enabled", () => {
},
},
},
["label2", "label1", "label5"]
["label2", "label1", "label5"],
);

expect(sut.enabled).toEqual(false);
Expand Down
6 changes: 3 additions & 3 deletions app/commands/close-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,21 @@ export class CloseCommand extends Command {
}

logger.info(
`Closing issue ${extractHtmlUrl(this.payload)}, reason: ${reason}`
`Closing issue ${extractHtmlUrl(this.payload)}, reason: ${reason}`,
);
try {
await closeIssue(
authToken,
sourceRepo,
extractLabelableId(this.payload),
reason
reason,
);
} catch (error) {
logger.error(
`Failed to close issue ${
error.errors ? JSON.stringify(error.errors) : ""
}`,
error
error,
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions app/commands/label-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@ export class LabelCommand extends Command {
});

logger.info(
`Labeling issue ${extractHtmlUrl(this.payload)} with labels ${labels}`
`Labeling issue ${extractHtmlUrl(this.payload)} with labels ${labels}`,
);
try {
await addLabel(
authToken,
this.payload.repository.owner.login,
sourceRepo,
extractLabelableId(this.payload),
labels
labels,
);
} catch (error) {
logger.error(
`Failed to add label ${
error.errors ? JSON.stringify(error.errors) : ""
}`,
error
error,
);
}
}
Expand Down
8 changes: 4 additions & 4 deletions app/commands/remove-label-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,23 @@ export class RemoveLabelCommand extends Command {

logger.info(
`Removing label(s) from issue ${extractHtmlUrl(
this.payload
)}, labels ${labels}`
this.payload,
)}, labels ${labels}`,
);
try {
await removeLabel(
authToken,
this.payload.repository.owner.login,
sourceRepo,
extractLabelableId(this.payload),
labels
labels,
);
} catch (error) {
logger.error(
`Failed to remove label ${
error.errors ? JSON.stringify(error.errors) : ""
}`,
error
error,
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/commands/reopen-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ export class ReopenCommand extends Command {
await reopenIssue(
authToken,
sourceRepo,
extractLabelableId(this.payload)
extractLabelableId(this.payload),
);
} catch (error) {
logger.error(
`Failed to reopen issue ${
error.errors ? JSON.stringify(error.errors) : ""
}`,
error
error,
);
}
}
Expand Down
10 changes: 5 additions & 5 deletions app/commands/reviewer-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ export class ReviewerCommand extends Command {

logger.info(
`Requesting review for ${reviewerMatches} at ${extractHtmlUrl(
this.payload
)}`
this.payload,
)}`,
);
const reviewers = extractUsersAndTeams(
this.payload.repository.owner.login,
reviewerMatches
reviewerMatches,
);
try {
await requestReviewers(
Expand All @@ -50,14 +50,14 @@ export class ReviewerCommand extends Command {
sourceRepo,
extractLabelableId(this.payload),
reviewers.users,
reviewers.teams
reviewers.teams,
);
} catch (error) {
logger.error(
`Failed to request reviewer ${
error.errors ? JSON.stringify(error.errors) : ""
}`,
error
error,
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions app/commands/transfer-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ export class TransferCommand extends Command {
});

logger.info(
`Transferring issue ${extractHtmlUrl(this.payload)} to repo ${targetRepo}`
`Transferring issue ${extractHtmlUrl(this.payload)} to repo ${targetRepo}`,
);
try {
await transferIssue(
authToken,
this.payload.repository.owner.login,
sourceRepo,
targetRepo,
extractLabelableId(this.payload)
extractLabelableId(this.payload),
);
} catch (error) {
logger.error(
`Failed to transfer issue ${
error.errors ? JSON.stringify(error.errors) : ""
}`,
error
error,
);
}
}
Expand Down
12 changes: 6 additions & 6 deletions app/comment-extractor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe("extractors", () => {
review: {
body: "review body",
},
})
}),
).toEqual("review body");
});

Expand All @@ -22,7 +22,7 @@ describe("extractors", () => {
comment: {
body: "comment body",
},
})
}),
).toEqual("comment body");
});
});
Expand All @@ -37,7 +37,7 @@ describe("extractors", () => {
pull_request: {
html_url: "https://github.com/some-org/some-repo/pull/1",
},
})
}),
).toEqual("https://github.com/some-org/some-repo/pull/1");
});

Expand All @@ -47,7 +47,7 @@ describe("extractors", () => {
issue: {
html_url: "https://github.com/some-org/some-repo/issue/1",
},
})
}),
).toEqual("https://github.com/some-org/some-repo/issue/1");
});
});
Expand All @@ -62,7 +62,7 @@ describe("extractors", () => {
pull_request: {
node_id: "PR_aaaaaa",
},
})
}),
).toEqual("PR_aaaaaa");
});

Expand All @@ -72,7 +72,7 @@ describe("extractors", () => {
issue: {
node_id: "PR_abcdefgh",
},
})
}),
).toEqual("PR_abcdefgh");
});
});
Expand Down
12 changes: 6 additions & 6 deletions app/converters.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe("converters", () => {
test("user and team", () => {
const converted = extractUsersAndTeams(
"test-org",
"@reviewer1,@test-org/team-1"
"@reviewer1,@test-org/team-1",
);

expect(converted).toEqual({
Expand All @@ -24,7 +24,7 @@ describe("converters", () => {
test("multiple users and teams", () => {
const converted = extractUsersAndTeams(
"test-org",
"@reviewer1,@test-org/team-1,@reviewer2,@test-org/team-2"
"@reviewer1,@test-org/team-1,@reviewer2,@test-org/team-2",
);

expect(converted).toEqual({
Expand All @@ -35,7 +35,7 @@ describe("converters", () => {
test("space separated users and teams", () => {
const converted = extractUsersAndTeams(
"test-org",
"@reviewer1 @test-org/team-1 @reviewer2 @test-org/team-2"
"@reviewer1 @test-org/team-1 @reviewer2 @test-org/team-2",
);

expect(converted).toEqual({
Expand All @@ -46,7 +46,7 @@ describe("converters", () => {
test("space and comma separated users and teams", () => {
const converted = extractUsersAndTeams(
"test-org",
"@reviewer1 @test-org/team-1,@reviewer2 @test-org/team-2"
"@reviewer1 @test-org/team-1,@reviewer2 @test-org/team-2",
);

expect(converted).toEqual({
Expand All @@ -57,7 +57,7 @@ describe("converters", () => {
test("remove empty entry in comma separated users and teams", () => {
const converted = extractUsersAndTeams(
"test-org",
"@reviewer1,@test-org/team-1,,@reviewer2,@test-org/team-2"
"@reviewer1,@test-org/team-1,,@reviewer2,@test-org/team-2",
);

expect(converted).toEqual({
Expand All @@ -68,7 +68,7 @@ describe("converters", () => {
test("remove empty string entry in comma separated users and teams", () => {
const converted = extractUsersAndTeams(
"test-org",
"@reviewer1,@test-org/team-1, ,@reviewer2,@test-org/team-2"
"@reviewer1,@test-org/team-1, ,@reviewer2,@test-org/team-2",
);

expect(converted).toEqual({
Expand Down
Loading
Loading