ThrowsAnalyzer.Cli
1.0.0-beta.2
This is a prerelease version of ThrowsAnalyzer.Cli.
dotnet tool install --global ThrowsAnalyzer.Cli --version 1.0.0-beta.2
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
dotnet tool install --local ThrowsAnalyzer.Cli --version 1.0.0-beta.2
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=ThrowsAnalyzer.Cli&version=1.0.0-beta.2&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package ThrowsAnalyzer.Cli --version 1.0.0-beta.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ThrowsAnalyzer CLI Tool
Command-line tool for analyzing C# projects and solutions for exception handling diagnostics using ThrowsAnalyzer.
Installation
dotnet tool install --global ThrowsAnalyzer.Cli
Quick Start
# Analyze a project
throws-analyzer analyze MyProject.csproj
# Analyze a solution
throws-analyzer analyze MySolution.sln
# Generate reports with verbose output
throws-analyzer analyze MyProject.csproj --verbose --open
Features
- Comprehensive Analysis: Runs all 30 ThrowsAnalyzer diagnostics on your codebase
- Dual Report Format: Generates both HTML and Markdown reports
- Interactive HTML Reports: Sortable tables, color-coded severity, code snippets
- Markdown Reports: GitHub-compatible documentation format
- Statistics Dashboard: Diagnostics by ID, project, severity, and file
- Flexible Filtering: Filter by diagnostic IDs, projects, severity levels
- CI/CD Ready: Exit codes and report formats suitable for automation
Usage
throws-analyzer analyze <path> [options]
Common Options
| Option | Description | Default |
|---|---|---|
-c, --configuration |
Build configuration (Debug/Release) | Debug |
-s, --min-severity |
Minimum severity (Error/Warning/Info) | Info |
-o, --output |
Output directory for reports | ./reports |
-f, --format |
Report format (html/markdown/both) | both |
-v, --verbose |
Show verbose output | false |
--open |
Open report after generation | false |
Examples
# Analyze with Release configuration
throws-analyzer analyze MySolution.sln -c Release
# Only show warnings and errors
throws-analyzer analyze MyProject.csproj -s Warning
# Custom output directory
throws-analyzer analyze MySolution.sln -o ./build/reports
# HTML report only
throws-analyzer analyze MyProject.csproj -f html --open
# Filter specific diagnostics
throws-analyzer analyze MySolution.sln -d THROWS004 THROWS021 THROWS026
# Analyze specific projects
throws-analyzer analyze MySolution.sln -p MyProject.Core MyProject.Api
Report Output
The tool generates comprehensive reports in ./reports/ by default:
analysis-report.html- Interactive HTML report with sortable tablesanalysis-report.md- Markdown report for documentation
Report Contents
- Summary statistics (total diagnostics, by severity)
- Diagnostics breakdown by ID, project, file
- Top files with most diagnostics
- Detailed diagnostics with code snippets
- Color-coded severity indicators
CI/CD Integration
GitHub Actions
- name: Install ThrowsAnalyzer CLI
run: dotnet tool install --global ThrowsAnalyzer.Cli
- name: Run Analysis
run: throws-analyzer analyze MySolution.sln -c Release -o ./reports
- name: Upload Reports
uses: actions/upload-artifact@v3
with:
name: throws-analyzer-reports
path: ./reports/
Exit Codes
0- Analysis completed successfully1- Analysis failed2- Invalid arguments
Documentation
For complete documentation, see:
ThrowsAnalyzer
The CLI tool uses ThrowsAnalyzer, a Roslyn analyzer with 30 diagnostic rules for exception handling:
- Basic Exception Handling (8 rules)
- Exception Flow Analysis (3 rules)
- Async Exception Patterns (3 rules)
- Iterator Exception Patterns (2 rules)
- Lambda Exception Patterns (2 rules)
- Best Practices (4 rules)
Install the analyzer directly in your projects:
dotnet add package ThrowsAnalyzer
License
MIT License - Copyright © 2025 Wiesław Šoltés
Support
- GitHub Issues: https://github.com/wieslawsoltes/ThrowsAnalyzer/issues
- Documentation: https://github.com/wieslawsoltes/ThrowsAnalyzer/tree/main/docs
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-beta.2 | 163 | 10/27/2025 |
| 1.0.0-beta.1 | 140 | 10/27/2025 |