Skip to content

Commit cc748a5

Browse files
authored
Merge pull request #6 from eNeRGy164/update-codebase
Update codebase
2 parents 32d670f + 8fe6d26 commit cc748a5

File tree

185 files changed

+3353
-7856
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+3353
-7856
lines changed

.editorconfig

Lines changed: 91 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,140 @@
1-
###############################
2-
# Core EditorConfig Options #
3-
###############################
1+
###############################
2+
# Core EditorConfig Options #
3+
###############################
44

5-
# All files
6-
[*]
5+
root = true
6+
7+
# All files
8+
[*]
79
charset = utf-8
810
end_of_line = crlf
9-
indent_style = space
11+
indent_style = space
1012
insert_final_newline = true
1113
trim_trailing_whitespace = true
1214

13-
[*.{csproj,xml,json,yaml}]
15+
[*.{csproj,xml,json,yml,yaml}]
1416
indent_size = 2
1517

1618
[*.md]
1719
trim_trailing_whitespace = false
1820

19-
# Code files
20-
[*.{cs,csx,vb,vbx}]
21-
indent_size = 4
22-
insert_final_newline = true
21+
# Code files
22+
[*.{cs,csx,vb,vbx}]
23+
indent_size = 4
24+
insert_final_newline = true
2325

24-
###############################
25-
# .NET Coding Conventions #
26-
###############################
26+
###############################
27+
# .NET Coding Conventions #
28+
###############################
2729

28-
[*.{cs,vb}]
29-
# Organize usings
30+
[*.{cs,vb}]
31+
# Organize usings
3032
dotnet_sort_system_directives_first = true
31-
# this. preferences
33+
34+
# this. preferences
3235
dotnet_style_qualification_for_field = true:warning
3336
dotnet_style_qualification_for_property = true:warning
3437
dotnet_style_qualification_for_method = true:warning
3538
dotnet_style_qualification_for_event = true:warning
36-
# Language keywords vs BCL types preferences
39+
40+
# Language keywords vs BCL types preferences
3741
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
3842
dotnet_style_predefined_type_for_member_access = true:warning
39-
# Parentheses preferences
43+
44+
# Parentheses preferences
4045
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion
4146
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion
4247
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion
4348
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion
44-
# Modifier preferences
45-
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
46-
dotnet_style_readonly_field = true:suggestion
47-
# Expression-level preferences
48-
dotnet_style_object_initializer = true:suggestion
49-
dotnet_style_collection_initializer = true:suggestion
50-
dotnet_style_explicit_tuple_names = true:suggestion
51-
dotnet_style_null_propagation = true:suggestion
52-
dotnet_style_coalesce_expression = true:suggestion
53-
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
54-
dotnet_prefer_inferred_tuple_names = true:suggestion
55-
dotnet_prefer_inferred_anonymous_type_member_names = true:suggestion
56-
dotnet_style_prefer_auto_properties = true:suggestion
57-
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
58-
dotnet_style_prefer_conditional_expression_over_return = false:warning
59-
60-
###############################
61-
# Naming Conventions #
62-
###############################
63-
# Style Definitions
64-
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
65-
# Use PascalCase for constant fields
66-
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
67-
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
68-
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
69-
dotnet_naming_symbols.constant_fields.applicable_kinds = field
70-
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
71-
dotnet_naming_symbols.constant_fields.required_modifiers = const
72-
73-
###############################
74-
# C# Coding Conventions #
75-
###############################
76-
[*.cs]
77-
# var preferences
78-
csharp_style_var_for_built_in_types = true
49+
50+
# Modifier preferences
51+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
52+
dotnet_style_readonly_field = true:suggestion
53+
54+
# Expression-level preferences
55+
dotnet_style_object_initializer = true:suggestion
56+
dotnet_style_collection_initializer = true:suggestion
57+
dotnet_style_explicit_tuple_names = true:suggestion
58+
dotnet_style_null_propagation = true:suggestion
59+
dotnet_style_coalesce_expression = true:suggestion
60+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
61+
dotnet_prefer_inferred_tuple_names = true:suggestion
62+
dotnet_prefer_inferred_anonymous_type_member_names = true:suggestion
63+
dotnet_style_prefer_auto_properties = true:suggestion
64+
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
65+
dotnet_style_prefer_conditional_expression_over_return = false:warning
66+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
67+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
68+
69+
###############################
70+
# Naming Conventions #
71+
###############################
72+
73+
# Style Definitions
74+
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
75+
76+
# Use PascalCase for constant fields
77+
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
78+
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
79+
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
80+
dotnet_naming_symbols.constant_fields.applicable_kinds = field
81+
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
82+
dotnet_naming_symbols.constant_fields.required_modifiers = const
83+
84+
###############################
85+
# C# Coding Conventions #
86+
###############################
87+
88+
[*.cs]
89+
# var preferences
90+
csharp_style_var_for_built_in_types = true
7991
csharp_style_var_when_type_is_apparent = true
8092
csharp_style_var_elsewhere = true
81-
# Expression-bodied members
93+
94+
# Expression-bodied members
8295
csharp_style_expression_bodied_methods = false:suggestion
8396
csharp_style_expression_bodied_constructors = false:suggestion
8497
csharp_style_expression_bodied_operators = false:suggestion
8598
csharp_style_expression_bodied_properties = true:suggestion
8699
csharp_style_expression_bodied_indexers = true:suggestion
87100
csharp_style_expression_bodied_accessors = true:suggestion
101+
88102
# Pattern matching preferences
89103
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
90104
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
91-
# Null-checking preferences
105+
106+
# Null-checking preferences
92107
csharp_style_throw_expression = true:suggestion
93108
csharp_style_conditional_delegate_call = true:suggestion
94-
# Modifier preferences
109+
110+
# Modifier preferences
95111
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:error
96-
# Expression-level preferences
112+
113+
# Expression-level preferences
97114
csharp_prefer_braces = true:silent
98115
csharp_style_deconstructed_variable_declaration = true:suggestion
99116
csharp_prefer_simple_default_expression = true:suggestion
100117
csharp_style_pattern_local_over_anonymous_function = true:suggestion
101118
csharp_style_inlined_variable_declaration = true:suggestion
102119

103-
###############################
104-
# C# Formatting Rules #
105-
###############################
106-
# New line preferences
120+
###############################
121+
# C# Formatting Rules #
122+
###############################
123+
124+
# New line preferences
107125
csharp_new_line_before_open_brace = all
108126
csharp_new_line_before_else = true
109127
csharp_new_line_before_catch = true
110128
csharp_new_line_before_finally = true
111129
csharp_new_line_before_members_in_object_initializers = true
112130
csharp_new_line_before_members_in_anonymous_types = true
113131
csharp_new_line_between_query_expression_clauses = true
132+
114133
# Indentation preferences
115134
csharp_indent_case_contents = true
116135
csharp_indent_switch_labels = true
117136
csharp_indent_labels = flush_left
137+
118138
# Space preferences
119139
csharp_space_after_cast = false
120140
csharp_space_after_keywords_in_control_flow_statements = true
@@ -127,6 +147,15 @@ csharp_space_around_binary_operators = before_and_after
127147
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
128148
csharp_space_between_method_call_name_and_opening_parenthesis = false
129149
csharp_space_between_method_call_empty_parameter_list_parentheses = false
150+
130151
# Wrapping preferences
131152
csharp_preserve_single_line_statements = true
132153
csharp_preserve_single_line_blocks = false
154+
csharp_using_directive_placement = outside_namespace:silent
155+
csharp_prefer_simple_using_statement = true:suggestion
156+
csharp_style_namespace_declarations = block_scoped:silent
157+
csharp_style_prefer_method_group_conversion = true:silent
158+
csharp_style_prefer_top_level_statements = true:silent
159+
csharp_style_prefer_primary_constructors = true:suggestion
160+
csharp_style_expression_bodied_lambdas = true:silent
161+
csharp_style_expression_bodied_local_functions = false:silent

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,3 +267,6 @@ pub/
267267

268268
*.runsettings
269269
lcov.info
270+
271+
# Visual Studio Live Unit Testing
272+
*.lutconfig

PlantUml.Builder.sln

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1717
EndProjectSection
1818
EndProject
1919
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{A0B2B200-EF68-4EAF-B6C7-3325A5E8F51B}"
20+
ProjectSection(SolutionItems) = preProject
21+
tests\.editorconfig = tests\.editorconfig
22+
EndProjectSection
2023
EndProject
2124
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PlantUml.Builder.Tests", "tests\PlantUml.Builder.Tests\PlantUml.Builder.Tests.csproj", "{778DB1FC-C2D6-4A51-8645-172895ECA3FE}"
2225
EndProject

src/PlantUml.Builder/ClassDiagrams/StringBuilderExtensions/Class.cs

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
using System;
2-
using System.Text;
3-
41
namespace PlantUml.Builder.ClassDiagrams;
52

63
public static partial class StringBuilderExtensions
@@ -10,27 +7,27 @@ public static partial class StringBuilderExtensions
107
/// </summary>
118
/// <param name="name">The name of the class. The name can't contain spaces.</param>
129
/// <param name="displayName">Optional display name. The display name can contain spaces.</param>
13-
/// <param name="isAbstract">Indicates wheter the class is abstract. Default <c>false</c>.</param>
10+
/// <param name="isAbstract">Indicates wheter the class is abstract. Default is <see langword="false"/>.</param>
1411
/// <param name="generics">Optional class extension.</param>
1512
/// <param name="stereotype">Optional stereo type.</param>
1613
/// <param name="customSpot">Optional custom spot.</param>
1714
/// <param name="tag">Optional tag.</param>
1815
/// <param name="url">Optional URL.</param>
1916
/// <param name="backgroundColor">Optional background color.</param>
2017
/// <param name="lineColor">Optional line color.</param>
21-
/// <param name="lineStyle">Optional line style.</param>
18+
/// <param name="lineStyle">Optional line style. See <see cref="LineStyle"/> for possible values.</param>
2219
/// <param name="extends">Optional extends.</param>
2320
/// <param name="implements">Optional implementations.</param>
24-
/// <exception cref="ArgumentNullException">Thrown when <paramref name="stringBuilder"/> is <c>null</c>.</exception>
25-
/// <exception cref="ArgumentException">Thrown when <paramref name="name"/> is <c>null</c>, empty of only white space.</exception>
21+
/// <exception cref="ArgumentNullException">Thrown when <paramref name="stringBuilder"/> is <see langword="null"/>.</exception>
22+
/// <exception cref="ArgumentException">Thrown when <paramref name="name"/> is <see langword="null"/>, empty of only white space.</exception>
2623
public static void Class(this StringBuilder stringBuilder, string name, string displayName = default, bool isAbstract = false, string generics = default, string stereotype = default, CustomSpot customSpot = default, string tag = default, Uri url = default, Color backgroundColor = default, Color lineColor = default, LineStyle lineStyle = LineStyle.None, string[] extends = default, string[] implements = default)
2724
{
28-
if (stringBuilder is null) throw new ArgumentNullException(nameof(stringBuilder));
25+
ArgumentNullException.ThrowIfNull(stringBuilder, nameof(stringBuilder));
2926

3027
if (isAbstract)
3128
{
32-
stringBuilder.Append(Constant.Abstract);
33-
stringBuilder.Append(Constant.Space);
29+
stringBuilder.Append(Constant.Words.Abstract);
30+
stringBuilder.Append(Constant.Symbols.Space);
3431
}
3532

3633
stringBuilder.ClassBase(ClassType.Class, name, displayName, generics, stereotype, customSpot, tag, url, backgroundColor, lineColor, lineStyle, extends, implements);
@@ -42,20 +39,20 @@ public static void Class(this StringBuilder stringBuilder, string name, string d
4239
/// </summary>
4340
/// <param name="name">The name of the class. The name can't contain spaces.</param>
4441
/// <param name="displayName">Optional display name. The display name can contain spaces.</param>
45-
/// <param name="visibility">Optional visibility.</param>
46-
/// <param name="isAbstract">Indicates wheter the class is abstract. Default <c>false</c>.</param>
42+
/// <param name="visibility">Optional visibility. See <see cref="VisibilityModifier"/> for possible values.</param>
43+
/// <param name="isAbstract">Indicates wheter the class is abstract. Default <see langword="false"/>.</param>
4744
/// <param name="generics">Optional class extension.</param>
4845
/// <param name="stereotype">Optional stereo type.</param>
4946
/// <param name="customSpot">Optional custom spot.</param>
5047
/// <param name="tag">Optional tag.</param>
5148
/// <param name="url">Optional URL.</param>
5249
/// <param name="backgroundColor">Optional background color.</param>
5350
/// <param name="lineColor">Optional line color.</param>
54-
/// <param name="lineStyle">Optional line style.</param>
51+
/// <param name="lineStyle">Optional line style. See <see cref="LineStyle"/> for possible values.</param>
5552
/// <param name="extends">Optional extends.</param>
5653
/// <param name="implements">Optional implements.</param>
57-
/// <exception cref="ArgumentNullException">Thrown when <paramref name="stringBuilder"/> is <c>null</c>.</exception>
58-
/// <exception cref="ArgumentException">Thrown when <paramref name="name"/> is <c>null</c>, empty of only white space.</exception>
54+
/// <exception cref="ArgumentNullException">Thrown when <paramref name="stringBuilder"/> is <see langword="null"/>.</exception>
55+
/// <exception cref="ArgumentException">Thrown when <paramref name="name"/> is <see langword="null"/>, empty of only white space.</exception>
5956
public static void ClassStart(this StringBuilder stringBuilder, string name, string displayName = default, VisibilityModifier visibility = VisibilityModifier.None, bool isAbstract = false, string generics = default, string stereotype = default, CustomSpot customSpot = default, string tag = default, Uri url = default, Color backgroundColor = default, Color lineColor = default, LineStyle lineStyle = LineStyle.None, string[] extends = default, string[] implements = default)
6057
{
6158
stringBuilder.VisibilityChar(visibility);
@@ -67,10 +64,10 @@ public static void ClassStart(this StringBuilder stringBuilder, string name, str
6764
/// <summary>
6865
/// Renders the end of a class.
6966
/// </summary>
70-
/// <exception cref="ArgumentNullException">Thrown when <paramref name="stringBuilder"/> is <c>null</c>.</exception>
67+
/// <exception cref="ArgumentNullException">Thrown when <paramref name="stringBuilder"/> is <see langword="null"/>.</exception>
7168
public static void ClassEnd(this StringBuilder stringBuilder)
7269
{
73-
if (stringBuilder is null) throw new ArgumentNullException(nameof(stringBuilder));
70+
ArgumentNullException.ThrowIfNull(stringBuilder);
7471

7572
stringBuilder.ClassBaseEnd();
7673
}

0 commit comments

Comments
 (0)