From c3dc474261f6ebaaed6538a04cc16753d81d6f22 Mon Sep 17 00:00:00 2001 From: Jan Paolo Go Date: Mon, 6 May 2019 19:50:48 -0500 Subject: [PATCH 1/6] add .editorconfig --- .editorconfig | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++ Squirrel.sln | 1 + 2 files changed, 97 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..2cce66b7d --- /dev/null +++ b/.editorconfig @@ -0,0 +1,96 @@ +[*.cs] + +#Core editorconfig formatting - indentation + +#use soft tabs (spaces) for indentation +indent_style = space + +#Formatting - indentation options + +#indent switch case contents. +csharp_indent_case_contents = true +#indent switch labels +csharp_indent_switch_labels = true + +#Formatting - new line options + +#place catch statements on a new line +csharp_new_line_before_catch = true +#place else statements on a new line +csharp_new_line_before_else = true +#require finally statements to be on a new line after the closing brace +csharp_new_line_before_finally = true +#require braces to be on a new line for properties, object_collection_array_initializers, types, control_blocks, lambdas, and methods (also known as "Allman" style) +csharp_new_line_before_open_brace = properties, object_collection_array_initializers, types, control_blocks, lambdas, methods + +#Formatting - organize using options + +#sort System.* using directives alphabetically, and place them before other usings +dotnet_sort_system_directives_first = true + +#Formatting - spacing options + +#require NO space between a cast and the value +csharp_space_after_cast = false +#require a space before the colon for bases or interfaces in a type declaration +csharp_space_after_colon_in_inheritance_clause = true +#require a space after a keyword in a control flow statement such as a for loop +csharp_space_after_keywords_in_control_flow_statements = true +#require a space before the colon for bases or interfaces in a type declaration +csharp_space_before_colon_in_inheritance_clause = true +#remove space within empty argument list parentheses +csharp_space_between_method_call_empty_parameter_list_parentheses = false +#remove space between method call name and opening parenthesis +csharp_space_between_method_call_name_and_opening_parenthesis = false +#do not place space characters after the opening parenthesis and before the closing parenthesis of a method call +csharp_space_between_method_call_parameter_list_parentheses = false +#remove space within empty parameter list parentheses for a method declaration +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +#place a space character after the opening parenthesis and before the closing parenthesis of a method declaration parameter list. +csharp_space_between_method_declaration_parameter_list_parentheses = false + +#Formatting - wrapping options + +#leave code block on single line +csharp_preserve_single_line_blocks = true + +#Style - expression bodied member options + +#prefer block bodies for accessors +csharp_style_expression_bodied_accessors = false:suggestion +#prefer block bodies for constructors +csharp_style_expression_bodied_constructors = false:suggestion +#prefer block bodies for methods +csharp_style_expression_bodied_methods = false:suggestion +#prefer block bodies for properties +csharp_style_expression_bodied_properties = false:suggestion + +#Style - expression level options + +#prefer out variables to be declared before the method call +csharp_style_inlined_variable_declaration = false:suggestion +#prefer the type name for member access expressions, instead of the language keyword +dotnet_style_predefined_type_for_member_access = false:suggestion + +#Style - implicit and explicit types + +#prefer var is used to declare variables with built-in system types such as int +csharp_style_var_for_built_in_types = true:suggestion +#prefer var when the type is already mentioned on the right-hand side of a declaration expression +csharp_style_var_when_type_is_apparent = true:suggestion + +#Style - language keyword and framework type options + +#prefer the language keyword for local variables, method parameters, and class members, instead of the type name, for types that have a keyword to represent them +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion + +#Style - qualification options + +#prefer events not to be prefaced with this. or Me. in Visual Basic +dotnet_style_qualification_for_event = false:suggestion +#prefer fields not to be prefaced with this. or Me. in Visual Basic +dotnet_style_qualification_for_field = false:suggestion +#prefer methods not to be prefaced with this. or Me. in Visual Basic +dotnet_style_qualification_for_method = false:suggestion +#prefer properties not to be prefaced with this. or Me. in Visual Basic +dotnet_style_qualification_for_property = false:suggestion diff --git a/Squirrel.sln b/Squirrel.sln index dd0d8df3c..571dc41d7 100644 --- a/Squirrel.sln +++ b/Squirrel.sln @@ -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 From abf66f11249c5dcbab91778df8856bba87397f83 Mon Sep 17 00:00:00 2001 From: Jan Paolo Go Date: Mon, 6 May 2019 19:53:29 -0500 Subject: [PATCH 2/6] remove visual basic comments --- .editorconfig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.editorconfig b/.editorconfig index 2cce66b7d..d5d6066e4 100644 --- a/.editorconfig +++ b/.editorconfig @@ -86,11 +86,11 @@ dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion #Style - qualification options -#prefer events not to be prefaced with this. or Me. in Visual Basic +#prefer events not to be prefaced with this. dotnet_style_qualification_for_event = false:suggestion -#prefer fields not to be prefaced with this. or Me. in Visual Basic +#prefer fields not to be prefaced with this. dotnet_style_qualification_for_field = false:suggestion -#prefer methods not to be prefaced with this. or Me. in Visual Basic +#prefer methods not to be prefaced with this. dotnet_style_qualification_for_method = false:suggestion -#prefer properties not to be prefaced with this. or Me. in Visual Basic +#prefer properties not to be prefaced with this. dotnet_style_qualification_for_property = false:suggestion From 11ff64bf3d8864d5eb4513e727a9ac06e224a08f Mon Sep 17 00:00:00 2001 From: gojanpaolo Date: Tue, 7 May 2019 08:54:23 -0500 Subject: [PATCH 3/6] add root = true and default settings --- .editorconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.editorconfig b/.editorconfig index d5d6066e4..28bb586e7 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,10 @@ +# top-most EditorConfig file +root = true + +[*] +insert_final_newline = true +trim_trailing_whitespace = true + [*.cs] #Core editorconfig formatting - indentation From 1be3c7d21125535c5fcd9e6fa49d85c162aae0b2 Mon Sep 17 00:00:00 2001 From: Jan Paolo Go Date: Tue, 7 May 2019 21:38:21 -0500 Subject: [PATCH 4/6] add clangformat Initial commit. I used FxHelper.cpp as reference. --- .clang-format | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..60a85a03c --- /dev/null +++ b/.clang-format @@ -0,0 +1,10 @@ +AlignTrailingComments: false +AllowShortIfStatementsOnASingleLine: true +BreakBeforeBraces: Linux +BreakInheritanceList: AfterColon +ColumnLimit: 0 +ConstructorInitializerIndentWidth: 2 +PointerBindsToType: true +SortIncludes: false +TabWidth: 2 +UseTab: Always From b73fd3af086e1592975c1109dae9fa73f1e7ce11 Mon Sep 17 00:00:00 2001 From: Jan Paolo Go Date: Tue, 7 May 2019 21:54:04 -0500 Subject: [PATCH 5/6] simplify editorconfig --- .editorconfig | 72 ++++++++++----------------------------------------- 1 file changed, 13 insertions(+), 59 deletions(-) diff --git a/.editorconfig b/.editorconfig index 28bb586e7..9f17507a3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,98 +6,52 @@ insert_final_newline = true trim_trailing_whitespace = true [*.cs] - -#Core editorconfig formatting - indentation - -#use soft tabs (spaces) for indentation indent_style = space +dotnet_sort_system_directives_first = true -#Formatting - indentation options - -#indent switch case contents. -csharp_indent_case_contents = true -#indent switch labels -csharp_indent_switch_labels = true - -#Formatting - new line options - -#place catch statements on a new line +# New line csharp_new_line_before_catch = true -#place else statements on a new line csharp_new_line_before_else = true -#require finally statements to be on a new line after the closing brace csharp_new_line_before_finally = true -#require braces to be on a new line for properties, object_collection_array_initializers, types, control_blocks, lambdas, and methods (also known as "Allman" style) csharp_new_line_before_open_brace = properties, object_collection_array_initializers, types, control_blocks, lambdas, methods -#Formatting - organize using options - -#sort System.* using directives alphabetically, and place them before other usings -dotnet_sort_system_directives_first = true +# Wrapping +csharp_preserve_single_line_blocks = true -#Formatting - spacing options +# Indentation +csharp_indent_case_contents = true +csharp_indent_switch_labels = true -#require NO space between a cast and the value +# Spacing csharp_space_after_cast = false -#require a space before the colon for bases or interfaces in a type declaration csharp_space_after_colon_in_inheritance_clause = true -#require a space after a keyword in a control flow statement such as a for loop csharp_space_after_keywords_in_control_flow_statements = true -#require a space before the colon for bases or interfaces in a type declaration csharp_space_before_colon_in_inheritance_clause = true -#remove space within empty argument list parentheses csharp_space_between_method_call_empty_parameter_list_parentheses = false -#remove space between method call name and opening parenthesis csharp_space_between_method_call_name_and_opening_parenthesis = false -#do not place space characters after the opening parenthesis and before the closing parenthesis of a method call csharp_space_between_method_call_parameter_list_parentheses = false -#remove space within empty parameter list parentheses for a method declaration csharp_space_between_method_declaration_empty_parameter_list_parentheses = false -#place a space character after the opening parenthesis and before the closing parenthesis of a method declaration parameter list. csharp_space_between_method_declaration_parameter_list_parentheses = false -#Formatting - wrapping options - -#leave code block on single line -csharp_preserve_single_line_blocks = true - -#Style - expression bodied member options - -#prefer block bodies for accessors +# Expression bodied member csharp_style_expression_bodied_accessors = false:suggestion -#prefer block bodies for constructors csharp_style_expression_bodied_constructors = false:suggestion -#prefer block bodies for methods csharp_style_expression_bodied_methods = false:suggestion -#prefer block bodies for properties csharp_style_expression_bodied_properties = false:suggestion -#Style - expression level options - -#prefer out variables to be declared before the method call +# Expression level csharp_style_inlined_variable_declaration = false:suggestion -#prefer the type name for member access expressions, instead of the language keyword dotnet_style_predefined_type_for_member_access = false:suggestion -#Style - implicit and explicit types - -#prefer var is used to declare variables with built-in system types such as int +# Implicit and explicit types csharp_style_var_for_built_in_types = true:suggestion -#prefer var when the type is already mentioned on the right-hand side of a declaration expression csharp_style_var_when_type_is_apparent = true:suggestion -#Style - language keyword and framework type options - -#prefer the language keyword for local variables, method parameters, and class members, instead of the type name, for types that have a keyword to represent them +# Language keyword and framework type dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion -#Style - qualification options - -#prefer events not to be prefaced with this. +# Qualification dotnet_style_qualification_for_event = false:suggestion -#prefer fields not to be prefaced with this. dotnet_style_qualification_for_field = false:suggestion -#prefer methods not to be prefaced with this. dotnet_style_qualification_for_method = false:suggestion -#prefer properties not to be prefaced with this. dotnet_style_qualification_for_property = false:suggestion From ba3611e641044845525f381e9c74496fefa52e94 Mon Sep 17 00:00:00 2001 From: Jan Paolo Go Date: Wed, 8 May 2019 20:25:55 -0500 Subject: [PATCH 6/6] override code style for nuget code --- .editorconfig | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.editorconfig b/.editorconfig index 9f17507a3..5d1138842 100644 --- a/.editorconfig +++ b/.editorconfig @@ -55,3 +55,29 @@ 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] + +# 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