From b509ae76558f806b6f077fa012581208a6dbb79b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 21 Sep 2025 22:32:37 +0000 Subject: [PATCH 1/2] Initial plan From 823fbc2a2efb9e39fb246350198817fd41faaa7e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 21 Sep 2025 22:37:41 +0000 Subject: [PATCH 2/2] Extract complex template string to generateUpdatedIssueBody helper method Co-authored-by: BorDevTech <73800053+BorDevTech@users.noreply.github.com> --- scripts/lint-automation/github-issue-creator.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/lint-automation/github-issue-creator.ts b/scripts/lint-automation/github-issue-creator.ts index 1539de7..20fd25d 100644 --- a/scripts/lint-automation/github-issue-creator.ts +++ b/scripts/lint-automation/github-issue-creator.ts @@ -250,7 +250,7 @@ class GitHubIssueCreator { // Only update if the count has changed (indicating new violations or fixes) if (newCount !== currentCount) { const updatedTitle = `🔧 Fix ${ruleId} violations (${newCount} instances)`; - const updatedBody = `${newGroup.body}\n\n---\n\n**🔄 Issue Updated:** ${new Date().toISOString()}\n**Previous Count:** ${currentCount} instances\n**Current Count:** ${newCount} instances`; + const updatedBody = this.generateUpdatedIssueBody(newGroup.body, currentCount, newCount); const response = await fetch(`${this.apiBase}/repos/${this.owner}/${this.repo}/issues/${existingIssue.number}`, { method: 'PATCH', @@ -769,6 +769,10 @@ function processData(data: unknown) { `; } + + private generateUpdatedIssueBody(newGroupBody: string, currentCount: number, newCount: number): string { + return `${newGroupBody}\n\n---\n\n**🔄 Issue Updated:** ${new Date().toISOString()}\n**Previous Count:** ${currentCount} instances\n**Current Count:** ${newCount} instances`; + } } // Main execution function