Skip to content

Commit

Permalink
36 move templates to embedded resources (#37)
Browse files Browse the repository at this point in the history
* Extracted tempates into embedded resources
* Added debugging profile using 'FromProject' as a target
* Code cleanup
  • Loading branch information
MelGrubb committed May 24, 2023
1 parent 4ed5c64 commit de11425
Show file tree
Hide file tree
Showing 21 changed files with 263 additions and 207 deletions.
109 changes: 73 additions & 36 deletions src/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,35 @@ resharper_redundant_base_qualifier_highlighting=warning
resharper_suggest_var_or_type_built_in_types_highlighting=hint
resharper_suggest_var_or_type_elsewhere_highlighting=hint
resharper_suggest_var_or_type_simple_types_highlighting=hint
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = false:suggestion
csharp_prefer_braces = true:suggestion
csharp_style_namespace_declarations = file_scoped:silent
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_expression_bodied_methods = when_on_single_line:none
csharp_style_expression_bodied_constructors = false:none
csharp_style_expression_bodied_operators = false:none
csharp_style_expression_bodied_properties = true:none
csharp_style_expression_bodied_indexers = true:none
csharp_style_expression_bodied_accessors = true:none
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_indent_labels = no_change
csharp_style_throw_expression = true:suggestion
csharp_style_prefer_null_check_over_type_check = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_prefer_local_over_anonymous_function = true:suggestion
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
csharp_style_prefer_tuple_swap = true:suggestion
csharp_style_prefer_utf8_string_literals = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
csharp_space_around_binary_operators = before_and_after


# Visual Studio Solution Files
Expand Down Expand Up @@ -207,9 +236,9 @@ spaces_around_operators=true

# Dotnet code style
[*.{cs,csx,vb,vbx,cake}]
end_of_line=crlf
end_of_line= crlf
indent_brace_style=Allman
indent_size=4
indent_size= 4
insert_final_newline=true
spaces_around_brackets=inside
spaces_around_operators=true
Expand Down Expand Up @@ -242,21 +271,21 @@ dotnet_style_parentheses_in_other_operators=always_for_clarity:silent

# Modifier preferences
dotnet_style_require_accessibility_modifiers=always:warning
dotnet_style_readonly_field=true:suggestion
dotnet_style_readonly_field= true:suggestion


# Expression-level preferences
dotnet_style_object_initializer=true:suggestion
dotnet_style_collection_initializer=true:suggestion
dotnet_style_explicit_tuple_names=true:suggestion
dotnet_style_null_propagation=true:suggestion
dotnet_style_coalesce_expression=true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method=true:silent
dotnet_style_object_initializer= true:suggestion
dotnet_style_collection_initializer= true:suggestion
dotnet_style_explicit_tuple_names= true:suggestion
dotnet_style_null_propagation= true:suggestion
dotnet_style_coalesce_expression= true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method= true:silent
dotnet_prefer_inferred_tuple_names=true:suggestion
dotnet_prefer_inferred_anonymous_type_member_names=true:suggestion
dotnet_style_prefer_auto_properties=true:silent
dotnet_style_prefer_conditional_expression_over_assignment=true:silent
dotnet_style_prefer_conditional_expression_over_return=true:silent
dotnet_style_prefer_auto_properties= true:silent
dotnet_style_prefer_conditional_expression_over_assignment= true:silent
dotnet_style_prefer_conditional_expression_over_return= true:silent


# Naming Styles:
Expand Down Expand Up @@ -338,52 +367,52 @@ dotnet_naming_symbols.type_parameters.applicable_kinds=type_parameter
# Note (From the docs): Naming conventions should be ordered from most-specific to least-specific.
# The first rule encountered that can be applied is the only rule that is applied, so put more-specific rules first.
dotnet_naming_rule.private_constant_fields.symbols=constant_fields
dotnet_naming_rule.private_constant_fields.style=camel_case_style
dotnet_naming_rule.private_constant_fields.severity=warning
dotnet_naming_rule.private_constant_fields.style = camel_case_style
dotnet_naming_rule.private_constant_fields.severity = warning

dotnet_naming_rule.non_private_constant_fields.symbols=constant_fields
dotnet_naming_rule.non_private_constant_fields.style=pascal_case_style
dotnet_naming_rule.non_private_constant_fields.severity=warning
dotnet_naming_rule.non_private_constant_fields.style = pascal_case_style
dotnet_naming_rule.non_private_constant_fields.severity = warning

dotnet_naming_rule.private_static_readonly_fields.symbols=private_static_readonly_fields
dotnet_naming_rule.private_static_readonly_fields.style=pascal_case_style
dotnet_naming_rule.private_static_readonly_fields.severity=warning
dotnet_naming_rule.private_static_readonly_fields.style = pascal_case_style
dotnet_naming_rule.private_static_readonly_fields.severity = warning

dotnet_naming_rule.private_readonly_fields.symbols=private_readonly_fields
dotnet_naming_rule.private_readonly_fields.style=underscore_style
dotnet_naming_rule.private_readonly_fields.severity=warning
dotnet_naming_rule.private_readonly_fields.style = underscore_style
dotnet_naming_rule.private_readonly_fields.severity = warning

dotnet_naming_rule.private_fields.symbols=private_fields
dotnet_naming_rule.private_fields.style=underscore_style
dotnet_naming_rule.private_fields.severity=warning
dotnet_naming_rule.private_fields.style = underscore_style
dotnet_naming_rule.private_fields.severity = warning

dotnet_naming_rule.namespace.symbols=namespaces
dotnet_naming_rule.namespace.style=pascal_case_style
dotnet_naming_rule.namespace.severity=error
dotnet_naming_rule.namespace.style = pascal_case_style
dotnet_naming_rule.namespace.severity = error

dotnet_naming_rule.interfaces.symbols=interfaces
dotnet_naming_rule.interfaces.style=interface_style
dotnet_naming_rule.interfaces.severity=warning
dotnet_naming_rule.interfaces.style = interface_style
dotnet_naming_rule.interfaces.severity = warning

dotnet_naming_rule.non_private_members.symbols=non_private_symbols
dotnet_naming_rule.non_private_members.style=pascal_case_style
dotnet_naming_rule.non_private_members.severity=warning
dotnet_naming_rule.non_private_members.style = pascal_case_style
dotnet_naming_rule.non_private_members.severity = warning

dotnet_naming_rule.async_methods.symbols=async_methods
dotnet_naming_rule.async_methods.style=async_style
dotnet_naming_rule.async_methods.severity=warning
dotnet_naming_rule.async_methods.style = async_style
dotnet_naming_rule.async_methods.severity = warning

dotnet_naming_rule.methods_and_properties.symbols=methods_and_properties
dotnet_naming_rule.methods_and_properties.style=pascal_case_style
dotnet_naming_rule.methods_and_properties.severity=warning
dotnet_naming_rule.methods_and_properties.style = pascal_case_style
dotnet_naming_rule.methods_and_properties.severity = warning

dotnet_naming_rule.parameters.symbols=parameters
dotnet_naming_rule.parameters.style=camel_case_style
dotnet_naming_rule.parameters.severity=warning
dotnet_naming_rule.parameters.style = camel_case_style
dotnet_naming_rule.parameters.severity = warning

dotnet_naming_rule.type_parameters.symbols=type_parameters
dotnet_naming_rule.type_parameters.style=type_parameter_style
dotnet_naming_rule.type_parameters.severity=suggestion
dotnet_naming_rule.type_parameters.style = type_parameter_style
dotnet_naming_rule.type_parameters.severity = suggestion


# Prefer "var" over explicit types
Expand Down Expand Up @@ -563,3 +592,11 @@ csharp_place_simple_initializer_on_single_line=true
csharp_trailing_comma_in_multiline_lists=true
csharp_wrap_array_initializer_style=chop_if_long
csharp_wrap_object_and_collection_initializer_style=chop_if_long
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class BuilderTests
public void Simple_does_not_populate_Orders()
{
var actual = UserBuilder.Simple().Build();
ShouldBeTestExtensions.ShouldBeOfType<User>(actual);
actual.ShouldBeOfType<User>();
actual.Orders.ShouldBeNull();
}

Expand All @@ -30,7 +30,7 @@ public void Simple_does_not_populate_Orders()
public void Typical_populates_Orders()
{
var actual = UserBuilder.Typical().Build();
ShouldBeTestExtensions.ShouldBeOfType<User>(actual);
actual.ShouldBeOfType<User>();
actual.Orders.ShouldNotBeNull();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void OrderBuilder_can_set_properties()
public void Simple_does_not_populate_Items()
{
var actual = OrderBuilder.Simple().Build();
ShouldBeTestExtensions.ShouldBeOfType<Order>(actual);
actual.ShouldBeOfType<Order>();
actual.Items.ShouldBeNull();
}

Expand All @@ -40,7 +40,7 @@ public void Simple_does_not_populate_Items()
public void Typical_populates_Items()
{
var actual = OrderBuilder.Typical().Build();
ShouldBeTestExtensions.ShouldBeOfType<Order>(actual);
actual.ShouldBeOfType<Order>();
actual.Items.ShouldNotBeNull();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class UserBuilderTests
public void Simple_does_not_populate_Orders()
{
var actual = UserBuilder.Simple().Build();
ShouldBeTestExtensions.ShouldBeOfType<User>(actual);
actual.ShouldBeOfType<User>();
actual.Orders.ShouldBeNull();
}

Expand All @@ -30,7 +30,7 @@ public void Simple_does_not_populate_Orders()
public void Typical_populates_Orders()
{
var actual = UserBuilder.Typical().Build();
ShouldBeTestExtensions.ShouldBeOfType<User>(actual);
actual.ShouldBeOfType<User>();
actual.Orders.ShouldNotBeNull();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class BuilderTests
public void Simple_does_not_populate_Orders()
{
var actual = UserBuilder.Simple().Build();
ShouldBeTestExtensions.ShouldBeOfType<User>(actual);
actual.ShouldBeOfType<User>();
actual.Orders.ShouldBeNull();
}

Expand All @@ -30,7 +30,7 @@ public void Simple_does_not_populate_Orders()
public void Typical_populates_Orders()
{
var actual = UserBuilder.Typical().Build();
ShouldBeTestExtensions.ShouldBeOfType<User>(actual);
actual.ShouldBeOfType<User>();
actual.Orders.ShouldNotBeNull();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void OrderBuilder_can_set_properties()
public void Simple_does_not_populate_Items()
{
var actual = OrderBuilder.Simple().Build();
ShouldBeTestExtensions.ShouldBeOfType<Order>(actual);
actual.ShouldBeOfType<Order>();
actual.Items.ShouldBeNull();
}

Expand All @@ -40,7 +40,7 @@ public void Simple_does_not_populate_Items()
public void Typical_populates_Items()
{
var actual = OrderBuilder.Typical().Build();
ShouldBeTestExtensions.ShouldBeOfType<Order>(actual);
actual.ShouldBeOfType<Order>();
actual.Items.ShouldNotBeNull();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class UserBuilderTests
public void Simple_does_not_populate_Orders()
{
var actual = UserBuilder.Simple().Build();
ShouldBeTestExtensions.ShouldBeOfType<User>(actual);
actual.ShouldBeOfType<User>();
actual.Orders.ShouldBeNull();
}

Expand All @@ -30,7 +30,7 @@ public void Simple_does_not_populate_Orders()
public void Typical_populates_Orders()
{
var actual = UserBuilder.Typical().Build();
ShouldBeTestExtensions.ShouldBeOfType<User>(actual);
actual.ShouldBeOfType<User>();
actual.Orders.ShouldNotBeNull();
}

Expand Down
15 changes: 0 additions & 15 deletions src/BuilderGenerator.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -385,21 +385,6 @@
&lt;Name /&gt;&#xD;
&lt;/Entry.SortBy&gt;&#xD;
&lt;/Entry&gt;&#xD;
&lt;Entry DisplayName="Instance Fields"&gt;&#xD;
&lt;Entry.Match&gt;&#xD;
&lt;And&gt;&#xD;
&lt;Not&gt;&#xD;
&lt;Static /&gt;&#xD;
&lt;/Not&gt;&#xD;
&lt;Kind Is="Field" /&gt;&#xD;
&lt;/And&gt;&#xD;
&lt;/Entry.Match&gt;&#xD;
&lt;Entry.SortBy&gt;&#xD;
&lt;Access /&gt;&#xD;
&lt;Static /&gt;&#xD;
&lt;Name /&gt;&#xD;
&lt;/Entry.SortBy&gt;&#xD;
&lt;/Entry&gt;&#xD;
&lt;Entry DisplayName="Events"&gt;&#xD;
&lt;Entry.Match&gt;&#xD;
&lt;Kind Is="Event" /&gt;&#xD;
Expand Down
Loading

0 comments on commit de11425

Please sign in to comment.