Skip to content

Commit

Permalink
Updated configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
mahara committed Dec 25, 2023
1 parent c25da5b commit 4b01395
Show file tree
Hide file tree
Showing 22 changed files with 341 additions and 253 deletions.
165 changes: 88 additions & 77 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ tab_width = 2


# Solution and project configuration files
[*.{props,targets,yml,ruleset,nuspec,vsixmanifest,vsct}]
[*.{props,targets,manifest,yml,ruleset,nuspec,vsixmanifest,vsct}]
indent_size = 2
tab_width = 2

Expand Down Expand Up @@ -76,56 +76,57 @@ dotnet_sort_system_directives_first = true
file_header_template = unset

# this. and Me. preferences
dotnet_style_qualification_for_event = false
dotnet_style_qualification_for_field = false
dotnet_style_qualification_for_method = false
dotnet_style_qualification_for_property = false
dotnet_style_qualification_for_event = false:silent
dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_method = false:silent
dotnet_style_qualification_for_property = false:silent

# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true
dotnet_style_predefined_type_for_member_access = true
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
dotnet_style_predefined_type_for_member_access = true:silent

# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent

# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent

# Expression-level preferences
dotnet_style_coalesce_expression = true
dotnet_style_collection_initializer = true
dotnet_style_explicit_tuple_names = true
dotnet_style_namespace_match_folder = true
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion
dotnet_diagnostic.IDE0130.severity = suggestion
dotnet_style_null_propagation = true
dotnet_style_object_initializer = true
dotnet_style_null_propagation = true:suggestion
dotnet_style_object_initializer = true:suggestion
dotnet_style_operator_placement_when_wrapping = end_of_line
dotnet_style_prefer_auto_properties = true
dotnet_style_prefer_compound_assignment = true
dotnet_style_prefer_conditional_expression_over_assignment = true
dotnet_style_prefer_conditional_expression_over_return = true
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_prefer_collection_expression = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed
dotnet_style_prefer_inferred_anonymous_type_member_names = true
dotnet_style_prefer_inferred_tuple_names = true
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
dotnet_style_prefer_simplified_boolean_expressions = true
dotnet_style_prefer_simplified_interpolation = true
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion

# Field preferences
dotnet_style_readonly_field = true
dotnet_style_readonly_field = true:suggestion

# Parameter preferences
dotnet_code_quality_unused_parameters = all
dotnet_code_quality_unused_parameters = all:suggestion

# Suppression preferences
dotnet_remove_unnecessary_suppression_exclusions = none

# New line preferences
dotnet_style_allow_multiple_blank_lines_experimental = true
dotnet_style_allow_statement_immediately_after_block_experimental = false
dotnet_style_allow_multiple_blank_lines_experimental = true:silent
dotnet_style_allow_statement_immediately_after_block_experimental = false:silent


#### Naming styles ####
Expand Down Expand Up @@ -177,11 +178,19 @@ dotnet_naming_style.begins_with_i.capitalization = pascal_case

# CA1307: Specify StringComparison for clarity
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1307
dotnet_diagnostic.CA1307.severity = suggestion
dotnet_diagnostic.CA1307.severity = warning

# CA1309: Use ordinal StringComparison
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1309
dotnet_diagnostic.CA1309.severity = suggestion
dotnet_diagnostic.CA1309.severity = warning

# CA1311: Specify a culture or use an invariant version
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1311
dotnet_diagnostic.CA1311.severity = warning

# CA1815: Override equals and operator equals on value types
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1815
dotnet_diagnostic.CA1815.severity = error


# C# files
Expand All @@ -190,64 +199,64 @@ dotnet_diagnostic.CA1309.severity = suggestion
#### C# Coding Conventions ####

# var preferences
csharp_style_var_elsewhere = true
csharp_style_var_for_built_in_types = true
csharp_style_var_when_type_is_apparent = true
csharp_style_var_elsewhere = true:silent
csharp_style_var_for_built_in_types = true:silent
csharp_style_var_when_type_is_apparent = true:silent

# Expression-bodied members
csharp_style_expression_bodied_accessors = true
csharp_style_expression_bodied_constructors = false
csharp_style_expression_bodied_indexers = true
csharp_style_expression_bodied_lambdas = true
csharp_style_expression_bodied_local_functions = false
csharp_style_expression_bodied_methods = false
csharp_style_expression_bodied_operators = false
csharp_style_expression_bodied_properties = true
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent

# Pattern matching preferences
csharp_style_pattern_matching_over_as_with_null_check = true
csharp_style_pattern_matching_over_is_with_cast_check = true
csharp_style_prefer_extended_property_pattern = true
csharp_style_prefer_not_pattern = true
csharp_style_prefer_pattern_matching = true
csharp_style_prefer_switch_expression = true
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_prefer_extended_property_pattern = true:suggestion
csharp_style_prefer_not_pattern = true:suggestion
csharp_style_prefer_pattern_matching = true:silent
csharp_style_prefer_switch_expression = true:suggestion

# Null-checking preferences
csharp_style_conditional_delegate_call = true
csharp_style_conditional_delegate_call = true:suggestion

# Modifier preferences
csharp_prefer_static_local_function = true
csharp_prefer_static_local_function = true:suggestion
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async

# Code-block preferences
csharp_prefer_braces = true
csharp_prefer_simple_using_statement = true
csharp_style_namespace_declarations = block_scoped
csharp_style_prefer_method_group_conversion = true
csharp_style_prefer_top_level_statements = true
csharp_prefer_braces = true:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_style_namespace_declarations = file_scoped:silent
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent

# Expression-level preferences
csharp_prefer_simple_default_expression = true
csharp_style_deconstructed_variable_declaration = true
csharp_style_implicit_object_creation_when_type_is_apparent = true
csharp_style_inlined_variable_declaration = true
csharp_style_prefer_index_operator = true
csharp_style_prefer_local_over_anonymous_function = true
csharp_style_prefer_null_check_over_type_check = true
csharp_style_prefer_range_operator = true
csharp_style_prefer_tuple_swap = true
csharp_style_prefer_utf8_string_literals = true
csharp_style_throw_expression = true
csharp_style_unused_value_assignment_preference = discard_variable
csharp_style_unused_value_expression_statement_preference = discard_variable
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_local_over_anonymous_function = true:suggestion
csharp_style_prefer_null_check_over_type_check = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
csharp_style_prefer_tuple_swap = true:suggestion
csharp_style_prefer_utf8_string_literals = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:silent

# 'using' directive preferences
csharp_using_directive_placement = inside_namespace
csharp_using_directive_placement = inside_namespace:silent

# New line preferences
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false
csharp_style_allow_embedded_statements_on_same_line_experimental = false
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false:silent
csharp_style_allow_embedded_statements_on_same_line_experimental = false:silent


#### C# Formatting Rules ####
Expand Down Expand Up @@ -296,6 +305,11 @@ csharp_space_between_square_brackets = false
# Wrapping preferences
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true
csharp_style_prefer_primary_constructors = false:suggestion
csharp_style_prefer_readonly_struct_member = true:suggestion
csharp_style_prefer_readonly_struct = true:suggestion
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent


# C# generated files
Expand All @@ -307,6 +321,3 @@ generated_code = true
[*.vb]
# Modifier preferences
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async



138 changes: 73 additions & 65 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,72 +1,80 @@
## https://git-scm.com/docs/gitattributes
## https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes
## https://github.com/gitattributes/gitattributes
## https://github.com/alexkaratarakis/gitattributes

# Set default behavior to automatically normalize line endings.
# Auto detect text files and perform LF normalization
* text=auto
* text=auto

# Set the merge driver for project and solution files
# Project and solution files
# Files that will always have CRLF line endings on checkout.
*.sln text eol=crlf
*.csproj text eol=crlf
*.props text eol=crlf
*.targets text eol=crlf
*.proj text eol=crlf
*.config text eol=crlf
*.json text eol=crlf
*.cs text eol=crlf
*.xml text eol=crlf
*.xaml text eol=crlf
*.html text eol=crlf
*.js text eol=crlf
*.map text eol=crlf
*.css text eol=crlf
*.less text eol=crlf
*.resx text eol=crlf
*.manifest text eol=crlf
*.txt text eol=crlf
*.cpp text eol=crlf
*.c text eol=crlf
*.h text eol=crlf
SOURCES text eol=crlf
MAKEFILE text eol=crlf

# Binary files that should not be modified.
*.exe binary
*.dll binary
*.pdb binary
*.xap binary
*.snk binary
*.png binary
*.ico binary
*.jpg binary
*.jpeg binary
*.gif binary
*.bmp binary
*.webp binary
*.cur binary
*.sys binary
*.chm binary

# Custom for Visual Studio
*.cs diff=csharp
*.js diff=astextplain
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain


*.sln text eol=crlf merge=union
*.manifest text eol=crlf
*.props text eol=crlf
*.targets text eol=crlf
*.json text
*.config text eol=crlf
*.ruleset text eol=crlf
*.resx text eol=crlf
*.xaml text eol=crlf diff=html
*.csproj text eol=crlf merge=union
*.cs text eol=crlf diff=csharp
*.csx text eol=crlf diff=csharp
*.cshtml text eol=crlf diff=html
*.vbproj text eol=crlf merge=union
*.vb text eol=crlf
*.vbx text eol=crlf
*.vbhtml text eol=crlf diff=html
*.vcxproj text eol=crlf merge=union
*.vcproj text eol=crlf merge=union
*.h text diff=cpp
*.c text diff=cpp
*.cpp text diff=cpp
SOURCES text
MAKEFILE text
*.fsproj text eol=crlf merge=union
*.fs text eol=crlf
*.sqlproj text eol=crlf merge=union
*.dbproj text eol=crlf merge=union
*.sql text
*.sqlgen text eol=crlf
*.wixproj text eol=crlf merge=union
*.proj text eol=crlf merge=union
*.xml text diff=html
*.xsd text diff=html
*.html text diff=html
*.htm text diff=html
*.css text diff=css
*.less text diff=css
*.ts text
*.js text
*.map text
*.ps1 text eol=crlf
*.psm1 text eol=crlf
*.psd1 text eol=crlf
*.ps1xml text eol=crlf
*.cmd text eol=crlf
*.bat text eol=crlf
*.licenseheader text eol=crlf
*.pubxml text eol=crlf
*.md text diff=markdown
*.txt text

# Binary files
*.exe binary
*.dll binary
*.pdb binary
*.msi binary
*.xap binary
*.snk binary
*.png binary
*.ico binary
*.jpg binary
*.jpeg binary
*.gif binary
*.bmp binary
*.webp binary
*.cur binary
*.sys binary
*.chm binary
Loading

0 comments on commit 4b01395

Please sign in to comment.