Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add editorconfig #1482

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
AlignTrailingComments: false
AllowShortIfStatementsOnASingleLine: true
BreakBeforeBraces: Linux
BreakInheritanceList: AfterColon
ColumnLimit: 0
ConstructorInitializerIndentWidth: 2
PointerBindsToType: true
SortIncludes: false
TabWidth: 2
UseTab: Always
83 changes: 83 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# top-most EditorConfig file
root = true

[*]
insert_final_newline = true
trim_trailing_whitespace = true

[*.cs]
indent_style = space
dotnet_sort_system_directives_first = true

# New line
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_open_brace = properties, object_collection_array_initializers, types, control_blocks, lambdas, methods

# Wrapping
csharp_preserve_single_line_blocks = true

# Indentation
csharp_indent_case_contents = true
csharp_indent_switch_labels = true

# Spacing
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false

# Expression bodied member
csharp_style_expression_bodied_accessors = false:suggestion
csharp_style_expression_bodied_constructors = false:suggestion
csharp_style_expression_bodied_methods = false:suggestion
csharp_style_expression_bodied_properties = false:suggestion

# Expression level
csharp_style_inlined_variable_declaration = false:suggestion
dotnet_style_predefined_type_for_member_access = false:suggestion

# Implicit and explicit types
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion

# Language keyword and framework type
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion

# Qualification
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

[/vendor/nuget/**.cs]
Copy link
Contributor

@shiftkey shiftkey May 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gojanpaolo I think the rules below also need to handle cpp files inside vendor/nuget/. When I ran eclint fix **/*.cpp to test out what this would detect it triggered a lot of whitespace changes (in project templates that live alongside the source).

Would that be possible to add in?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shiftkey We can by doing this [/vendor/nuget/**.{cs,cpp}]
but I don't see cpp files inside vendor/nuget/

I ran eclint fix **/*.cpp and the whitespace changes were on files inside the src folder and it's because of the default settings in the .editorconfig


# Expression bodied member
csharp_style_expression_bodied_accessors = false:none
csharp_style_expression_bodied_constructors = false:none
csharp_style_expression_bodied_methods = false:none
csharp_style_expression_bodied_operators = false:none
csharp_style_expression_bodied_properties = false:none

# Expression level
csharp_style_inlined_variable_declaration = false:none
dotnet_style_predefined_type_for_member_access = false:none

# Implicit and explicit types
csharp_style_var_for_built_in_types = false:none
csharp_style_var_when_type_is_apparent = true:none

# Language keyword and framework type
dotnet_style_predefined_type_for_locals_parameters_members = true:none

# Qualification
dotnet_style_qualification_for_event = false:none
dotnet_style_qualification_for_field = false:none
dotnet_style_qualification_for_method = false:none
dotnet_style_qualification_for_property = false:none
1 change: 1 addition & 0 deletions Squirrel.sln
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SyncReleases", "src\SyncRel
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionLevel", "SolutionLevel", "{ED657D2C-F8A0-4012-A64F-7367D41BE4D2}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
src\SolutionAssemblyInfo.cs = src\SolutionAssemblyInfo.cs
src\Squirrel.nuspec = src\Squirrel.nuspec
vendor\wix\template.wxs = vendor\wix\template.wxs