Skip to content

Commit bc1b728

Browse files
authored
fix(duplicate-code-detector): require noop when no duplication found (#17836)
1 parent 42b6879 commit bc1b728

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/duplicate-code-detector.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,20 @@ Create separate issues for each distinct duplication pattern found (maximum 3 pa
107107
- Limit to the top 3 most significant patterns if more are found
108108
- Use the `create_issue` tool from safe-outputs MCP **once for each pattern**
109109

110+
**When No Issues Are Found**:
111+
112+
**YOU MUST CALL** the `noop` tool when analysis completes without finding significant duplication:
113+
114+
```json
115+
{
116+
"noop": {
117+
"message": "✅ Duplicate code analysis complete. Analyzed [N] files changed recently. No significant duplication detected (threshold: >10 lines or 3+ similar patterns)."
118+
}
119+
}
120+
```
121+
122+
**DO NOT just write this message in your output text** - you MUST actually invoke the `noop` tool. The workflow will fail if you don't call either `create_issue` or `noop`.
123+
110124
**Issue Contents for Each Pattern**:
111125
- **Executive Summary**: Brief description of this specific duplication pattern
112126
- **Duplication Details**: Specific locations and code blocks for this pattern only
@@ -231,6 +245,7 @@ For each distinct duplication pattern found, create a separate issue using this
231245
- Suggest practical refactoring approaches
232246
- Assign issue to @copilot for automated remediation
233247
- Use descriptive titles that clearly identify the specific pattern (e.g., "Duplicate Code: Error Handling Pattern in Parser Module")
248+
- **If no significant duplication found, call `noop` tool** - never complete without calling either `create_issue` or `noop`
234249

235250
## Tool Usage Sequence
236251

0 commit comments

Comments
 (0)