https://github.com/credfeto/credfeto-dotnet-codeanalysis-override
Utility for managing code analysis rulesets with overrides for pre-release and release builds
https://github.com/credfeto/credfeto-dotnet-codeanalysis-override
code-analysis-tool dotnet dotnet-tool
Last synced: 2 months ago
JSON representation
Utility for managing code analysis rulesets with overrides for pre-release and release builds
- Host: GitHub
- URL: https://github.com/credfeto/credfeto-dotnet-codeanalysis-override
- Owner: credfeto
- License: mit
- Created: 2025-08-19T09:31:18.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2026-07-18T21:08:38.000Z (2 months ago)
- Last Synced: 2026-07-19T05:47:16.582Z (2 months ago)
- Topics: code-analysis-tool, dotnet, dotnet-tool
- Language: C#
- Homepage:
- Size: 2.05 MB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# credfeto-dotnet-codeanalysis-override
Dotnet code analysis override tool
dotnet tool to allow configured overrides for CodeAnalysis.ruleset files allowing a lower set of analysis rules for development and pre-release builds compared to release builds. This allows developers to work with rules like being able to add TODO's and comment out code while developing, but prohibits them in builds in pull requests and release builds.
## Installing
```bash
dotnet tool install Credfeto.DotNet.Code.Analysis.Overrides.Cmd
```
## Usage
```bash
dotnet code-analysis ruleset \
--ruleset "CodeAnalysis.ruleset" \
--changes "release.rule-settings.json"
```
### Sample override rules file
```json
[
{
"ruleSet": "SonarAnalyzer.CSharp",
"rule": "S125",
"state": "Error",
"description": "No commented out code."
},
{
"ruleSet": "FunFair.CodeAnalysis",
"rule": "FFS0008",
"state": "Error",
"description": "Use of non-whitelisted #pragma warning"
},
{
"ruleSet": "FunFair.CodeAnalysis",
"rule": "FFS0040",
"state": "None",
"description": "Filename must match typename"
},
{
"ruleSet": "FunFair.CodeAnalysis",
"rule": "FFS0042",
"state": "None",
"description": "Do not have TODO's in SuppressMessage"
},
{
"ruleSet": "Meziantou.Analyzer",
"rule": "MA0026",
"state": "None",
"description": "Do not leave TODO's scattered around"
},
{
"ruleSet": "oslynator.Analyzers",
"rule": "MA0026",
"state": "None",
"description": "File With no code"
}
]
```
## Build Status
| Branch | Status |
|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| main | [](https://github.com/credfeto/credfeto-dotnet-codeanalysis-override/actions/workflows/build-and-publish-pre-release.yml) |
| release | [](https://github.com/credfeto/credfeto-dotnet-codeanalysis-override/actions/workflows/build-and-publish-release.yml) |
## Changelog
View [changelog](CHANGELOG.md)
## Contributors