Skip to content

Commit cba5bdb

Browse files
committed
Add .editorconfig
Closes #133
1 parent bab373d commit cba5bdb

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

src/.editorconfig

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# EditorConfig is awesome:http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Don't use tabs for indentation.
7+
[*]
8+
indent_style = space
9+
# (Please don't specify an indent_size here; that has too many unintended consequences.)
10+
11+
# Code files
12+
[*.{cs,csx,vb,vbx}]
13+
indent_size = 4
14+
15+
# Xml project files
16+
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
17+
indent_size = 2
18+
19+
# Xml config files
20+
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
21+
indent_size = 2
22+
23+
# JSON files
24+
[*.json]
25+
indent_size = 2
26+
27+
# Dotnet code style settings:
28+
[*.{cs,vb}]
29+
# Sort using and Import directives with System.* appearing first
30+
dotnet_sort_system_directives_first = true
31+
# Use "this." and "Me." everywhere
32+
dotnet_style_qualification_for_field = true:warning
33+
dotnet_style_qualification_for_property = true:warning
34+
dotnet_style_qualification_for_method = true:warning
35+
dotnet_style_qualification_for_event = true:warning
36+
37+
# Use language keywords instead of framework type names for type references
38+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
39+
dotnet_style_predefined_type_for_member_access = true:suggestion
40+
41+
# Suggest more modern language features when available
42+
dotnet_style_object_initializer = true:suggestion
43+
dotnet_style_collection_initializer = true:suggestion
44+
dotnet_style_coalesce_expression = true:suggestion
45+
dotnet_style_null_propagation = true:suggestion
46+
dotnet_style_explicit_tuple_names = true:suggestion
47+
48+
# CSharp code style settings:
49+
[*.cs]
50+
# Prefer "var" everywhere
51+
csharp_style_var_for_built_in_types = false:none
52+
csharp_style_var_when_type_is_apparent = true:suggestion
53+
csharp_style_var_elsewhere = false:suggestion
54+
55+
# Prefer method-like constructs to have a block body
56+
csharp_style_expression_bodied_methods = true:suggestion
57+
csharp_style_expression_bodied_constructors = true:suggestion
58+
csharp_style_expression_bodied_operators = true:suggestion
59+
60+
# Prefer property-like constructs to have an expression-body
61+
csharp_style_expression_bodied_properties = true:suggestion
62+
csharp_style_expression_bodied_indexers = true:suggestion
63+
csharp_style_expression_bodied_accessors = true:suggestion
64+
65+
# Suggest more modern language features when available
66+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
67+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
68+
csharp_style_inlined_variable_declaration = true:suggestion
69+
csharp_style_throw_expression = true:suggestion
70+
csharp_style_conditional_delegate_call = true:suggestion
71+
72+
# Newline settings
73+
csharp_new_line_before_open_brace = all
74+
csharp_new_line_before_else = true
75+
csharp_new_line_before_catch = true
76+
csharp_new_line_before_finally = true
77+
csharp_new_line_before_members_in_object_initializers = true
78+
csharp_new_line_before_members_in_anonymous_types = true

src/Nerdbank.GitVersioning.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Project("{5DD5E4FA-CB73-4610-85AB-557B54E96AA9}") = "Nerdbank.GitVersioning.NuGe
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4BD1A7CD-6F52-4F5A-825B-50E4D8C3ECFF}"
99
ProjectSection(SolutionItems) = preProject
10+
.editorconfig = .editorconfig
1011
..\.gitignore = ..\.gitignore
1112
..\appveyor.yml = ..\appveyor.yml
1213
..\build.ps1 = ..\build.ps1

0 commit comments

Comments
 (0)