Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcod7alex <cod7alex@gmail.com>2017-03-13 22:04:59 +0300
committercod7alex <cod7alex@gmail.com>2017-03-13 22:04:59 +0300
commitec03ffcb71722f3f3d729156eaf744c29d3f205c (patch)
tree6a6572dc13de30489638c0822819c25befb5f017 /.editorconfig
parentb9199d7133c9e7d80e4ed2f01018cc66fabc5470 (diff)
Added to .editorconfig csharp code style settings supported by Visual Studio 2017.
Diffstat (limited to '.editorconfig')
-rw-r--r--.editorconfig53
1 files changed, 53 insertions, 0 deletions
diff --git a/.editorconfig b/.editorconfig
index b1d0cb2b48..ff5575b5c0 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -14,6 +14,59 @@ indent_size = 4
[project.json]
indent_size = 2
+# C# files
+[*.cs]
+# brace begins on a new line
+csharp_new_line_before_open_brace = all
+
+# block indentation
+csharp_indent_block_contents = true
+
+# avoid this. unless absolutely necessary
+dotnet_style_qualification_for_field = false:suggestion
+dotnet_style_qualification_for_property = false:suggestion
+dotnet_style_qualification_for_method = false:suggestion
+dotnet_style_qualification_for_event = false:suggestion
+
+# only use var when it's obvious what the variable type is
+csharp_style_var_elsewhere = false:suggestion
+
+# use language keywords instead of BCL types
+dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
+dotnet_style_predefined_type_for_member_access = true:suggestion
+
+# name all constant fields using PascalCase
+dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
+dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
+dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
+
+dotnet_naming_symbols.constant_fields.applicable_kinds = field
+dotnet_naming_symbols.constant_fields.required_modifiers = const
+
+dotnet_naming_style.pascal_case_style.capitalization = pascal_case
+
+# static fields should have s_ prefix
+dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
+dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
+dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
+
+dotnet_naming_symbols.static_fields.applicable_kinds = field
+dotnet_naming_symbols.static_fields.required_modifiers = static
+
+dotnet_naming_style.static_prefix_style.required_prefix = s_
+dotnet_naming_style.static_prefix_style.capitalization = camel_case
+
+# internal and private fields should be _camelCase
+dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
+dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
+dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
+
+dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
+dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
+
+dotnet_naming_style.camel_case_underscore_style.required_prefix = _
+dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
+
# C++ Files
[*.{cpp,h,in}]
curly_bracket_next_line = true