From acd5c607c0f81dcff211bdc4f9e3827a9ebde352 Mon Sep 17 00:00:00 2001 From: Wei He Date: Tue, 19 Nov 2024 01:34:01 +0000 Subject: [PATCH] chore: add @wei/pluralize for logging --- deno.json | 1 + deno.lock | 4 +++- src/processor/pull.ts | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/deno.json b/deno.json index 9fe007d38..e8831f667 100644 --- a/deno.json +++ b/deno.json @@ -17,6 +17,7 @@ "@probot/pino": "npm:@probot/pino@^2.5.0", "@std/assert": "jsr:@std/assert@1", "@std/http": "jsr:@std/http@1", + "@wei/pluralize": "jsr:@wei/pluralize@^8.0.2", "@wei/probot-scheduler": "jsr:@wei/probot-scheduler@0.1.0-alpha.15", "bullmq": "npm:bullmq@^5.26.2", "express": "npm:express@^4.21.1", diff --git a/deno.lock b/deno.lock index c573cfe2a..a0e957f6c 100644 --- a/deno.lock +++ b/deno.lock @@ -12,6 +12,7 @@ "jsr:@std/path@^1.0.8": "1.0.8", "jsr:@std/streams@^1.0.8": "1.0.8", "jsr:@wei/pluralize@^8.0.1": "8.0.2", + "jsr:@wei/pluralize@^8.0.2": "8.0.2", "jsr:@wei/probot-scheduler@0.1.0-alpha.15": "0.1.0-alpha.15", "npm:@octokit/auth-app@^7.1.3": "7.1.3", "npm:@octokit/plugin-rest-endpoint-methods@^13.2.6": "13.2.6_@octokit+core@6.1.2", @@ -74,7 +75,7 @@ "@wei/probot-scheduler@0.1.0-alpha.15": { "integrity": "d95bbf7d41a41e50dd5e210b741a893f9adeea64261d0be25571e9b92255e549", "dependencies": [ - "jsr:@wei/pluralize", + "jsr:@wei/pluralize@^8.0.1", "npm:@octokit/auth-app", "npm:bullmq", "npm:ioredis", @@ -1586,6 +1587,7 @@ "dependencies": [ "jsr:@std/assert@1", "jsr:@std/http@1", + "jsr:@wei/pluralize@^8.0.2", "jsr:@wei/probot-scheduler@0.1.0-alpha.15", "npm:@octokit/plugin-rest-endpoint-methods@^13.2.6", "npm:@probot/pino@^2.5.0", diff --git a/src/processor/pull.ts b/src/processor/pull.ts index 199ccf6d3..0cc31ccf7 100644 --- a/src/processor/pull.ts +++ b/src/processor/pull.ts @@ -1,4 +1,5 @@ import { type Logger, ProbotOctokit } from "probot"; +import pluralize from "@wei/pluralize"; import { type PullConfig, pullConfigSchema, @@ -52,7 +53,7 @@ export class Pull { async routineCheck(): Promise { this.logger.info( { config: this.config }, - `Routine Check - ${this.config.rules.length} rules`, + `Routine Check - ${pluralize("rule", this.config.rules.length, true)}`, ); for (const rule of this.config.rules) {