Skip to content

Commit f94b942

Browse files
Copilotbcollamore
andauthored
docs: cleanup copilot-instructions.md with dogfooding and coverage validation (#1010)
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: bcollamore <[email protected]>
1 parent 0bdc2e3 commit f94b942

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

.github/copilot-instructions.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,34 @@ dotnet test --configuration Release --logger "trx;LogFileName=test-results.trx"
5454

5555
# 3. Check formatting
5656
dotnet format style --verify-no-changes --no-restore --verbosity detailed # NEVER CANCEL: ~23s
57+
58+
# 4. Run dogfooding process (validate analyzers work on own codebase)
59+
# Use MCP server run_dogfood tool or manual process via CI workflow
60+
61+
# 5. Verify code coverage meets 80% SonarCloud requirement
62+
# Use MCP server analyze_coverage tool to check coverage gaps
5763
```
5864

59-
Total validation time: ~2m 32s - NEVER CANCEL these commands.
65+
Total validation time: ~2m 32s + dogfood/coverage checks - NEVER CANCEL these commands.
6066

6167
### Dogfooding Process
6268
This repository uses a "dogfooding" process where the analyzers analyze their own code:
6369
- Build creates analyzer packages with `.Dogfood` suffix
6470
- Analyzers are then applied to the codebase itself
6571
- All analyzer violations must be fixed, not suppressed
6672

73+
### Code Coverage Requirements
74+
SonarCloud enforces **80% code coverage** and will fail the build if this threshold is not met:
75+
- Current coverage is over 90%, so maintain this high standard
76+
- Use the **MCP server `analyze_coverage` tool** to identify coverage gaps and get actionable suggestions
77+
- Tool provides specific test templates and prioritizes areas needing coverage
78+
- Focus testing on error handling, edge cases, and complex logic paths
79+
6780
### Mandatory CI Requirements
6881
The CI process enforces these checks that will cause build failures:
6982
- All tests must pass (1903 tests)
7083
- Code formatting must be perfect (no deviations from .editorconfig)
84+
- **80% code coverage minimum** (enforced by SonarCloud)
7185
- All analyzer warnings must be addressed (no suppressions allowed)
7286
- Dogfood process must complete successfully
7387

@@ -121,7 +135,7 @@ All code MUST strictly follow these .editorconfig rules:
121135

122136
**FORMATTING IS ZERO-TOLERANCE**: Any violation fails the build (IDE0055.severity = error)
123137

124-
**Auto-fix tool available**: Use the MCP server `fix_formatting` tool to auto-correct all formatting issues instead of manual fixes.
138+
**Auto-fix available**: Use the MCP server `fix_formatting` tool to auto-correct all formatting violations.
125139

126140
### Creating New Analyzers
127141
When creating new analyzers:
@@ -144,6 +158,7 @@ Analyzers run during compilation and must be performant:
144158
- **Title format**: Must follow Conventional Commits (feat:, fix:, docs:, etc.)
145159
- **All tests pass**: 1903 tests must pass
146160
- **Formatting perfect**: Zero formatting violations
161+
- **80% code coverage**: Maintained or improved coverage required
147162
- **No suppressions**: Fix underlying issues, don't suppress warnings
148163
- **Documentation**: Update relevant docs in Documentation/ folder
149164

@@ -178,22 +193,19 @@ dotnet clean # Removes packages automatically
178193

179194
### Troubleshooting
180195

181-
### ⚠️ Formatting Issues (IDE0055)
182-
**Most common CoPilot failure**: Formatting violations that consume 25% of agent effort.
196+
### Formatting Issues (IDE0055)
197+
**Common CoPilot failure**: Formatting violations consume significant agent effort.
183198

184-
**SOLUTION**: Use the MCP server `fix_formatting` tool:
185-
1. Automatically corrects CRLF line endings (not LF)
186-
2. Fixes indentation to tabs (not spaces)
187-
3. Applies all .editorconfig rules
188-
4. Ensures CI compliance
199+
**Quick fix**: Use the MCP server `fix_formatting` tool to automatically correct CRLF line endings, tabs, braces, and other .editorconfig violations.
189200

190201
**Manual check**: `dotnet format style --verify-no-changes --no-restore --verbosity detailed`
191202

192203
### Build Failures
193204
If builds fail:
194-
1. Check formatting first: `dotnet format style --verify-no-changes --no-restore --verbosity detailed`
195-
2. Run clean build: `dotnet clean && dotnet build --configuration Release`
205+
1. Run clean build: `dotnet clean && dotnet build --configuration Release`
206+
2. Check formatting: `dotnet format style --verify-no-changes --no-restore --verbosity detailed`
196207
3. Review analyzer violations - fix the code, don't suppress warnings
208+
4. Verify code coverage meets 80% requirement
197209

198210
### Test Failures
199211
If tests fail:

0 commit comments

Comments
 (0)