.editorconfig files in your project. This allows you to customize the analyzer’s behavior at the solution, project, or even file level.
How Configuration Works
CommentSense uses the standard.editorconfig format to read configuration options. All CommentSense options are prefixed with comment_sense. and should be placed under the [*.cs] section to apply to all C# files.
Basic .editorconfig Structure
The
.editorconfig file should be placed in your project root or solution directory. Options cascade from parent directories, with more specific (closer) files taking precedence.Configuration Scope
You can configure CommentSense at different levels:- Solution-level: Place
.editorconfigin your solution root - Project-level: Place
.editorconfigin individual project directories - File-level: Use glob patterns to target specific files or directories
Example: Different Rules for Different Directories
Common Configuration Patterns
Minimal Configuration (Defaults)
By default, CommentSense uses sensible defaults. You don’t need any configuration to get started:Strict Documentation Standards
For projects with high documentation standards:Relaxed for Internal Code
For internal projects or utilities:Configuration Options Reference
CommentSense provides configuration options in the following categories:Visibility Levels
Control which members are analyzed based on their accessibility
Quality Checks
Configure low quality detection, langwords, ghost references, and tag ordering
Exception Documentation
Configure which exceptions to document and exception scanning behavior
Advanced Options
Conditional suppression, constant/enum exclusions, and implicit inheritdoc
Prerequisites
Validation and Testing
After configuring CommentSense:- Rebuild your project to ensure the analyzer picks up the new settings
- Check the Error List in Visual Studio to see active diagnostics
- Test with sample code to verify the configuration behaves as expected
Configuration changes are applied immediately when the
.editorconfig file is saved, but you may need to reload files or rebuild to see all changes reflected in the IDE.Next Steps
Set Visibility Level
Configure which members should be analyzed based on visibility levels
Enable Quality Checks
Set up quality checks for documentation standards
Configure Exceptions
Customize exception documentation requirements
Fine-tune Advanced Options
Explore advanced configuration for edge cases