mfogliatto / mfogliatto/ReferenceCop
Introduce tracing capabilities for debugging rule triggers
- Dominant language
- C#
- Stars
- 1
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
## Description
We need to introduce tracing capabilities in ReferenceCop to help debug why certain references trigger specific rules. These traces would be left in verbose log files in the output directory for diagnostic purposes.
## Problem
Currently, when a rule is triggered, it can be difficult to understand exactly why that happened, especially in complex build scenarios. Better tracing would help users understand and debug rule violations.
## Proposed Solution
1. Add tracing capabilities to the MSBuild task and Roslyn analyzer
2. Include relevant information in traces (rule details, reference details, context)
3. Make trace verbosity configurable
4. Ensure traces appear in a separate log file in a readable format
## Implementation Details
- Consider using the MSBuild logging APIs for the build task
- Use appropriate diagnostics mechanisms for the Roslyn analyzer
- Ensure tracing is minimal by default but can be increased for debugging
- Add clear documentation on how to enable and interpret traces
## Acceptance Criteria
- Traces provide useful information about rule triggers
- Trace verbosity is configurable
- Performance impact is minimal when tracing is not enabled
- Documentation explains how to use the tracing features for debugging
## Notes
Not sure yet how much this would be useful, but it could help diagnose issues in complex build scenarios.
Contributor guide
Research direction
Start by locating the MSBuild task and Roslyn analyzer entry points, then review the relevant MSBuild logging APIs and Roslyn diagnostic mechanisms. Define how rule, reference, and context details are captured, how verbosity is configured, and where the separate readable log is written. Done means both components provide useful configurable traces, default tracing has minimal performance impact, and documentation explains enabling and interpreting them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- build-system, devtools, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100