Skip to content

feat: update duplicate-code-detector to focus only on Go files and exclude JavaScript#1943

Merged
pelikhan merged 2 commits intomainfrom
copilot/update-duplicate-finder-ignore-js
Oct 18, 2025
Merged

feat: update duplicate-code-detector to focus only on Go files and exclude JavaScript#1943
pelikhan merged 2 commits intomainfrom
copilot/update-duplicate-finder-ignore-js

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 18, 2025

Summary

Updated the duplicate-code-detector workflow to analyze only Go source files and explicitly exclude all JavaScript files (including .cjs) from duplicate code analysis.

Changes

1. JavaScript File Exclusion

Added explicit exclusion of all JavaScript file types to prevent analysis of JavaScript files:

  • .js, .cjs, .mjs - JavaScript files
  • .jsx, .tsx - React/TypeScript JSX files
  • .ts - TypeScript files

These exclusions are now documented in two critical sections:

  • Changed Files Analysis section - to prevent initial file selection
  • Skip These Patterns section - to clarify what should not be analyzed

2. Go-Only Analysis Focus

Added explicit restriction to analyze ONLY .go files:

  • New instruction in "Changed Files Analysis": "ONLY analyze .go files - exclude all other file types"
  • New "File Type Restriction" in "Analysis Depth" section
  • Updated all analysis descriptions to reference .go files specifically
  • Changed focus from "all files" to "all .go files" in Primary and Secondary Analysis sections

3. Issue Assignment

Verified that created issues are properly assigned to @copilot for automated remediation:

  • Issue template includes **Assignee**: @copilot
  • Operational guidelines confirm assignment for automated remediation

Rationale

The duplicate-code-detector workflow uses Serena's semantic code analysis, which is most effective when focused on a single language ecosystem. By restricting analysis to Go files only:

  1. Reduces false positives - JavaScript and Go have different idioms and patterns
  2. Improves analysis quality - Serena can focus on Go-specific duplication patterns
  3. Reduces execution time - Fewer files to analyze means faster workflow completion
  4. Better resource utilization - Avoids analyzing files that aren't relevant to the Go codebase

Testing

  • ✅ Workflow compiles successfully with 0 errors and 0 warnings (improved from 2 warnings)
  • ✅ All unit tests pass
  • ✅ Changes reflected in both .md source and compiled .lock.yml workflow
  • ✅ Code formatted according to project standards

Related Issue

Addresses requirements to:

  • Ignore all JavaScript files (.cjs and related extensions)
  • Focus analysis only on .go files
  • Ensure issues are assigned to @copilot
Original prompt
  • Update duplicate finder to IGNORE all JavaScript files .cjs. Only focus on .go files
  • assign the created issue to copilot

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

…xclude all JavaScript files

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update duplicate finder to ignore JavaScript files feat: update duplicate-code-detector to focus only on Go files and exclude JavaScript Oct 18, 2025
Copilot AI requested a review from pelikhan October 18, 2025 12:52
@pelikhan pelikhan marked this pull request as ready for review October 18, 2025 12:53
@pelikhan pelikhan merged commit a9b996e into main Oct 18, 2025
5 checks passed
@pelikhan pelikhan deleted the copilot/update-duplicate-finder-ignore-js branch October 18, 2025 12:54
@github-actions
Copy link
Copy Markdown
Contributor

Agentic Changeset Generator triggered by this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants