Skip to content

Add Item 16: Do not call overridable methods in constructors #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/EffectiveCSharp.Analyzers/Build/Config/General.globalconfig
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
is_global = true
# We need to be careful with the global_level value:
# - In .NET 5: A compiler warning is reported and both entries are ignored
# - In .NET 6+: The entry from the file with a higher value for global_level takes precedence.
# - In .NET 6+: The entry from the file with a higher value for global_level takes precedence.
# If the global_level is equal in two files and the values configured conflict,
# a compiler warning is reported and BOTH entries are ignored.
global_level = -12
global_level = -12

# Title : Use implicit type
# Category : Style
Expand Down Expand Up @@ -41,9 +41,16 @@ dotnet_diagnostic.CA1061.severity = warning
# Effective C# Item #12 - Prefer member initializers to assignment statements
dotnet_diagnostic.CA1805.severity = warning

# Title: : Do not call overridable methods in constructors
# Category : Usage
# Help Link: https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2214
#
# Effective C# Item #16 - Never call virtual functions in constructors
dotnet_diagnostic.CA2214.severity = warning

# Title: : Implement the standard Dispose pattern
# Category : Design
# Help Link: https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1063
#
# Effective C# Item #17 - Implement the standard Dispose pattern
dotnet_diagnostic.CA1063.severity = warning
dotnet_diagnostic.CA1063.severity = warning
Loading