Skip to content

Commit

Permalink
Update EditorConfig and Git files
Browse files Browse the repository at this point in the history
- Add default Git attributes.
- Update Git ignores to latest.
- Merge duplicate EditorConfig rules.
- Format projects to EditorConfig rules.
- Fix formatting errors in 'Guard.md' file.
  • Loading branch information
Nirmal4G committed Jun 7, 2022
1 parent 0891891 commit 5fdbc87
Show file tree
Hide file tree
Showing 16 changed files with 189 additions and 230 deletions.
47 changes: 20 additions & 27 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,6 @@ indent_style = space
# New line preferences
end_of_line = unset
insert_final_newline = false
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
dotnet_style_readonly_field = true:warning
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
dotnet_style_predefined_type_for_member_access = true:warning
dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning
dotnet_style_allow_statement_immediately_after_block_experimental = false:warning
dotnet_style_allow_multiple_blank_lines_experimental = false:warning
dotnet_style_qualification_for_field = true:warning
dotnet_style_qualification_for_property = false:warning
dotnet_style_qualification_for_method = false:warning
dotnet_style_qualification_for_event = false:warning

#### Build files ####

Expand Down Expand Up @@ -58,14 +47,14 @@ insert_final_newline = true
#### .NET Coding Conventions ####

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

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

# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
Expand All @@ -74,7 +63,11 @@ 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:silent
dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning

# Code block preferences
dotnet_style_allow_multiple_blank_lines_experimental = false:warning
dotnet_style_allow_statement_immediately_after_block_experimental = false:warning

# Expression-level preferences
csharp_style_deconstructed_variable_declaration = true:suggestion
Expand All @@ -90,10 +83,10 @@ dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
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_is_null_check_over_reference_equality_method = true:warning

# Field preferences
dotnet_style_readonly_field = true:suggestion
dotnet_style_readonly_field = true:warning

#### C# Coding Conventions ####

Expand All @@ -112,6 +105,7 @@ csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = false:silent

# Pattern matching preferences
csharp_style_prefer_pattern_matching = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion

Expand All @@ -123,9 +117,15 @@ csharp_preferred_modifier_order = public,private,protected,internal,static,exter

# Code-block preferences
csharp_prefer_braces = true:suggestion
csharp_using_directive_placement = outside_namespace:warning
csharp_style_namespace_declarations = file_scoped:warning
csharp_style_unused_value_assignment_preference = discard_variable:warning
csharp_style_unused_value_expression_statement_preference = discard_variable:warning
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false:warning

# Expression-level preferences
csharp_prefer_simple_default_expression = true:suggestion
csharp_prefer_static_local_function = true:warning
csharp_style_pattern_local_over_anonymous_function = true:warning

#### C# Formatting Rules ####
Expand Down Expand Up @@ -381,10 +381,3 @@ dotnet_diagnostic.SA1629.severity = none
dotnet_diagnostic.SA1633.severity = none
dotnet_diagnostic.SA1634.severity = none
dotnet_diagnostic.SA1652.severity = none
csharp_using_directive_placement = outside_namespace:warning
csharp_style_unused_value_assignment_preference = discard_variable:warning
csharp_style_unused_value_expression_statement_preference = discard_variable:warning
csharp_prefer_static_local_function = true:warning
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false:warning
csharp_style_prefer_pattern_matching = true:suggestion
csharp_style_namespace_declarations = file_scoped:warning
109 changes: 48 additions & 61 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,63 +1,50 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
# Set default file-type attributes

# All file types
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.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
# Markups
*.md text=auto diff=markdown
*.mdx text=auto diff=markdown

# Solutions
*.sln text=auto eol=crlf
*.slnx text=auto

# Projects
*.*proj text=auto
*.tasks text=auto
*.props text=auto
*.targets text=auto

# Sources
*.cs text=auto diff=csharp
*.csx text=auto diff=csharp
*.resx text=auto

# Scripts
*.in text eol=lf
*.sh text eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf

# Images
*.png binary
*.jpg binary
*.gif binary

# Keys
*.snk binary
*.pfx binary
*.cer binary

# Others

# Preserve Line endings in diff and patch files
*.diff -text
*.patch -text

# Exclude git meta files from exporting
.gitattributes export-ignore
.gitignore export-ignore
.gitkeep export-ignore
Loading

0 comments on commit 5fdbc87

Please sign in to comment.