Skip to content

Instantly share code, notes, and snippets.

View kurnakovv's full-sized avatar
🖥️
just a tech...

kurnakovv

🖥️
just a tech...
View GitHub Profile
@kurnakovv
kurnakovv / .editorconfig
Last active November 29, 2025 05:53
Favorite Roslynator rules in .editorconfig
[*.cs]
##
## Roslynator
##
# All rules here https://josefpihrt.github.io/docs/roslynator/configuration
# Disable all rules
dotnet_analyzer_diagnostic.category-roslynator.severity = none
# Row length limits
@kurnakovv
kurnakovv / .editorconfig
Last active December 10, 2025 11:19
Favorite StyleCop.Analyzers rules in .editorconfig
# https://gist.github.com/kurnakovv/70a5d76dc5f3eb9ef114b182283cb407
##
## StyleCop.Analyzers
##
# All rules here https://github.com/DotNetAnalyzers/StyleCopAnalyzers/tree/master/documentation
# Disable all rules
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.AlternativeRules.severity = none
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.DocumentationRules.severity = none
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.LayoutRules.severity = none
@kurnakovv
kurnakovv / DotnetFormat-GitBranchChanges.ps1
Created November 3, 2025 07:30
Run dotnet format only for current git branch changes | PowerShell script
$baseBranch = "main" # or "master"
$currentBranch = git rev-parse --abbrev-ref HEAD
# Get changed file names in current branch
$files = git diff --name-only $baseBranch
# Delete useless spaces
$files = $files | Where-Object { $_ -ne "" }
if ($files.Count -eq 0) {
@kurnakovv
kurnakovv / DotnetFormat-GitCurrentChanges.ps1
Last active November 3, 2025 07:43
Run dotnet format only for git changes (`git status` files)
# Get git current changes (file names)
$files = git status --porcelain | ForEach-Object {
$_.Substring(3)
}
if ($files.Count -eq 0) {
Write-Host "No diff"
exit
}
@kurnakovv
kurnakovv / .editorconfig
Last active November 15, 2025 06:00
All IDisposableAnalyzers rules in .editorconfig
##
## IDisposableAnalyzers rules
##
# All rules here https://github.com/DotNetAnalyzers/IDisposableAnalyzers
dotnet_diagnostic.IDISP001.severity = suggestion # Dispose created
dotnet_diagnostic.IDISP002.severity = suggestion # Dispose member
dotnet_diagnostic.IDISP003.severity = suggestion # Dispose previous before re-assigning
dotnet_diagnostic.IDISP004.severity = suggestion # Don't ignore created IDisposable
dotnet_diagnostic.IDISP005.severity = suggestion # Return type should indicate that the value should be disposed
@kurnakovv
kurnakovv / .editorconfig
Last active November 15, 2025 06:11
Favorite Code analysis (CAxxxx) rules in .editorconfig
[*.cs]
##
## Code analysis (CAxxxx) rules
##
# All rules here https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/categories
### Design rules ###
# ✅ Good
@kurnakovv
kurnakovv / .editorconfig
Last active November 16, 2025 03:47
Favorite Code-style (IDExxxx) rules in .editorconfig
[*.cs]
##
## Code-style (IDExxxx) rules
##
# All rules here https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules
dotnet_analyzer_diagnostic.category-Style.severity = error
dotnet_analyzer_diagnostic.category-CodeQuality.severity = error
@kurnakovv
kurnakovv / .editorconfig
Last active November 15, 2025 05:58
WarningsAsErrors for all nullable codes in .editorconfig | NullReferenceException (NRE)
[*.cs]
##
## NullReferenceException (NRE) or nullable
##
# All rules here https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/nullable-warnings
# Thrown value may be null.
dotnet_diagnostic.CS8597.severity = error
@kurnakovv
kurnakovv / .editorconfig
Last active November 15, 2025 05:56
Disable all JetBrains ReSharper InspectCode rules in .editorconfig
[*.cs]
##
## JetBrains ReSharper InspectCode
##
# All rules here https://www.jetbrains.com/help/resharper/Reference__Code_Inspections_CSHARP.html
# Method invocation is skipped
resharper_invocation_is_skipped_highlighting = none
@kurnakovv
kurnakovv / .editorconfig
Last active November 15, 2025 05:55
Disable all StyleCop.Analyzers rules in .editorconfig
[*.cs]
##
## StyleCop.Analyzers
##
# All rules here https://github.com/DotNetAnalyzers/StyleCopAnalyzers/tree/master/documentation
# A violation of this rule occurs when a compilation (project) contains one or more files which are parsed with the DocumentationMode set to None. This most frequently occurs when the project is configured to not produce an XML documentation file during the build.
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA0001.md
dotnet_diagnostic.SA0001.severity = none