Add Roslynator, SonarAnalyzer.CSharp, Meziantou.Analyzer, and AsyncFixer as central analyzer references (Directory.Build.targets, CPM-versioned, guarded on ManagePackageVersionsCentrally so the gitignored .mcp tool isn't affected). .editorconfig defaults dotnet_analyzer_diagnostic.severity to `suggestion` so the packs surface findings without failing the TreatWarningsAsErrors (TWAE) build; rules are promoted to warning/error incrementally (promotion = enforcement via the existing TWAE build, so no separate lint step is needed). StyleCop.Analyzers is intentionally excluded: its latest stable (1.1.118) crashes (AD0001) on C# records and overlaps the existing .editorconfig/Roslynator. Blazor .razor: editorconfig severity overrides don't reach analyzer diagnostics in Razor @code (source-generator limitation; dotnet format can't fix them either), so the currently-firing SonarAnalyzer rules are temporarily NoWarn-ed in ErsatzTV.csproj and burned down rule-by-rule in #25. The same rules run at suggestion on .cs. Formatting normalization (mixed UTF-8 BOM + whitespace) is deferred to its own PR. Full-solution Release build green (0 errors, 0 warnings). Refs #15 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
123 lines
5.5 KiB
INI
123 lines
5.5 KiB
INI
[*]
|
|
charset=utf-8
|
|
end_of_line=lf
|
|
trim_trailing_whitespace=true
|
|
insert_final_newline=true
|
|
indent_style=space
|
|
indent_size=4
|
|
|
|
# Microsoft .NET properties
|
|
csharp_new_line_before_members_in_object_initializers=false
|
|
csharp_preferred_modifier_order=public, private, protected, internal, new, abstract, virtual, sealed, override, static, readonly, extern, unsafe, volatile, async:suggestion
|
|
csharp_style_expression_bodied_accessors=true:suggestion
|
|
csharp_style_expression_bodied_constructors=true:none
|
|
csharp_style_expression_bodied_methods=true:none
|
|
csharp_style_expression_bodied_properties=true:suggestion
|
|
csharp_style_var_elsewhere=false:suggestion
|
|
csharp_style_var_for_built_in_types=false:none
|
|
csharp_style_var_when_type_is_apparent=true:suggestion
|
|
dotnet_naming_rule.local_constants_rule.severity=warning
|
|
dotnet_naming_rule.local_constants_rule.style=all_upper_style
|
|
dotnet_naming_rule.local_constants_rule.symbols=local_constants_symbols
|
|
dotnet_naming_style.all_upper_style.capitalization=all_upper
|
|
dotnet_naming_style.all_upper_style.word_separator=_
|
|
dotnet_naming_symbols.local_constants_symbols.applicable_accessibilities=*
|
|
dotnet_naming_symbols.local_constants_symbols.applicable_kinds=local
|
|
dotnet_naming_symbols.local_constants_symbols.required_modifiers=const
|
|
dotnet_style_parentheses_in_arithmetic_binary_operators=never_if_unnecessary:none
|
|
dotnet_style_parentheses_in_other_binary_operators=never_if_unnecessary:none
|
|
dotnet_style_parentheses_in_relational_binary_operators=never_if_unnecessary:none
|
|
dotnet_style_predefined_type_for_locals_parameters_members=true:suggestion
|
|
dotnet_style_predefined_type_for_member_access=true:suggestion
|
|
dotnet_style_qualification_for_event=false:suggestion
|
|
dotnet_style_qualification_for_field=false:suggestion
|
|
dotnet_style_qualification_for_method=false:suggestion
|
|
dotnet_style_qualification_for_property=false:suggestion
|
|
dotnet_style_require_accessibility_modifiers=for_non_interface_members:suggestion
|
|
|
|
# ReSharper properties
|
|
resharper_autodetect_indent_settings=true
|
|
resharper_braces_for_for=required
|
|
resharper_braces_for_foreach=required
|
|
resharper_braces_for_ifelse=required
|
|
resharper_braces_for_while=required
|
|
resharper_csharp_arguments_literal=positional
|
|
resharper_csharp_arguments_named=positional
|
|
resharper_csharp_insert_final_newline=true
|
|
resharper_csharp_max_attribute_length_for_same_line=0
|
|
resharper_csharp_place_accessorholder_attribute_on_same_line=never
|
|
resharper_csharp_place_field_attribute_on_same_line=if_owner_is_single_line
|
|
resharper_csharp_wrap_after_declaration_lpar=true
|
|
resharper_csharp_wrap_after_invocation_lpar=true
|
|
resharper_csharp_wrap_arguments_style=chop_if_long
|
|
resharper_csharp_wrap_parameters_style=chop_if_long
|
|
resharper_enforce_line_ending_style=true
|
|
resharper_for_built_in_types=use_var_when_evident
|
|
resharper_space_within_single_line_array_initializer_braces=true
|
|
resharper_use_indent_from_vs=false
|
|
resharper_wrap_array_initializer_style=chop_if_long
|
|
|
|
# ReSharper inspection severities
|
|
resharper_arrange_redundant_parentheses_highlighting=hint
|
|
resharper_arrange_this_qualifier_highlighting=hint
|
|
resharper_arrange_type_member_modifiers_highlighting=hint
|
|
resharper_arrange_type_modifiers_highlighting=hint
|
|
resharper_built_in_type_reference_style_for_member_access_highlighting=hint
|
|
resharper_built_in_type_reference_style_highlighting=hint
|
|
resharper_redundant_base_qualifier_highlighting=warning
|
|
resharper_suggest_var_or_type_built_in_types_highlighting=hint
|
|
resharper_suggest_var_or_type_elsewhere_highlighting=hint
|
|
resharper_suggest_var_or_type_simple_types_highlighting=none
|
|
resharper_web_config_module_not_resolved_highlighting=warning
|
|
resharper_web_config_type_not_resolved_highlighting=warning
|
|
resharper_web_config_wrong_module_highlighting=warning
|
|
|
|
[{*.har,*.inputactions,*.jsb2,*.jsb3,*.json,.babelrc,.eslintrc,.stylelintrc,bowerrc,jest.config}]
|
|
indent_style=space
|
|
indent_size=2
|
|
|
|
[*.{appxmanifest,asax,ascx,aspx,build,cg,cginc,compute,cs,cshtml,dtd,fs,fsi,fsscript,fsx,hlsl,hlsli,hlslinc,master,ml,mli,nuspec,razor,resw,resx,shader,skin,usf,ush,vb,xaml,xamlx,xoml,xsd}]
|
|
indent_style=space
|
|
indent_size=4
|
|
tab_width=4
|
|
|
|
[*.yml]
|
|
indent_style = space
|
|
indent_size = 2
|
|
|
|
[*.json]
|
|
ij_json_array_wrapping = normal
|
|
ij_json_keep_blank_lines_in_code = 0
|
|
ij_json_keep_indents_on_empty_lines = false
|
|
ij_json_keep_line_breaks = true
|
|
ij_json_keep_trailing_comma = false
|
|
ij_json_object_wrapping = normal
|
|
ij_json_property_alignment = do_not_align
|
|
ij_json_space_after_colon = true
|
|
ij_json_space_after_comma = true
|
|
ij_json_space_before_colon = false
|
|
ij_json_space_before_comma = false
|
|
ij_json_spaces_within_braces = true
|
|
ij_json_spaces_within_brackets = true
|
|
ij_json_wrap_long_lines = false
|
|
|
|
[*.cs]
|
|
# disable CA1848: Use the LoggerMessage delegates`
|
|
dotnet_diagnostic.ca1848.severity = none
|
|
|
|
# --- Static-analysis pack adoption (ersatztv#15) ---
|
|
# Roslynator / SonarAnalyzer / Meziantou / AsyncFixer are referenced centrally
|
|
# (Directory.Build.targets). Default every analyzer diagnostic to `suggestion` so the new
|
|
# packs don't fail the TreatWarningsAsErrors build; high-value rules get promoted to
|
|
# warning/error one at a time (see ersatztv#15 / docs/contributing.md). Explicit per-rule
|
|
# severities (e.g. ca1848 above) still take precedence over this bulk default.
|
|
dotnet_analyzer_diagnostic.severity = suggestion
|
|
|
|
# Blazor components: analyzers run on .razor/.cshtml @code too, and TWAE would otherwise
|
|
# turn their default-severity findings into build errors — keep them at suggestion as well.
|
|
[*.razor]
|
|
dotnet_analyzer_diagnostic.severity = suggestion
|
|
|
|
[*.cshtml]
|
|
dotnet_analyzer_diagnostic.severity = suggestion
|