Skip to content

Commit 1ecba3b

Browse files
Initial code commit
- Initial commit of all code for this library. - Workflows for builds using GitHub actions. - Updated LICENSE.txt to fix non-ASCII characters.
1 parent d6a651d commit 1ecba3b

40 files changed

+2976
-3
lines changed

.editorconfig

Lines changed: 275 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,275 @@
1+
# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
2+
# Code files
3+
[*.{cs,csx,vb,vbx}]
4+
tab_width = 4
5+
indent_size = 4
6+
indent_style = space
7+
insert_final_newline = true
8+
end_of_line = crlf
9+
charset = utf-8
10+
[*.{cs,vb}]
11+
# Organize usings
12+
dotnet_separate_import_directive_groups = false
13+
dotnet_sort_system_directives_first = true
14+
15+
# this. and Me. preferences
16+
dotnet_style_qualification_for_field = false:warning
17+
dotnet_style_qualification_for_property = false:warning
18+
dotnet_style_qualification_for_method = false:warning
19+
dotnet_style_qualification_for_event = false:warning
20+
21+
# Language keywords vs BCL types preferences
22+
dotnet_style_predefined_type_for_locals_parameters_members = true:error
23+
dotnet_style_predefined_type_for_member_access = true:error
24+
25+
# Parentheses preferences
26+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion
27+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion
28+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion
29+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:warning
30+
31+
# Modifier preferences
32+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
33+
dotnet_style_readonly_field = true:suggestion
34+
35+
# Expression-level preferences
36+
dotnet_style_object_initializer = true:warning
37+
dotnet_style_collection_initializer = true:warning
38+
dotnet_style_explicit_tuple_names = true:suggestion
39+
dotnet_style_null_propagation = true:suggestion
40+
dotnet_style_coalesce_expression = true:suggestion
41+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
42+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
43+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
44+
dotnet_style_prefer_auto_properties = true:warning
45+
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
46+
dotnet_style_prefer_conditional_expression_over_return = true:silent
47+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
48+
dotnet_style_prefer_compound_assignment = true:suggestion
49+
dotnet_style_prefer_simplified_boolean_expressions = true:warning
50+
dotnet_style_prefer_simplified_interpolation = true:suggestion
51+
52+
dotnet_style_namespace_match_folder = true:error
53+
54+
dotnet_style_allow_multiple_blank_lines_experimental = true:suggestion
55+
dotnet_style_allow_statement_immediately_after_block_experimental = true:suggestion
56+
57+
# Parameter preferences
58+
dotnet_code_quality_unused_parameters = all:warning
59+
60+
###############################
61+
# Naming Conventions #
62+
###############################
63+
64+
# Naming rules
65+
66+
dotnet_naming_rule.interface_should_be_begins_with_i.severity = error
67+
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
68+
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
69+
70+
dotnet_naming_rule.types_should_be_pascal_case.severity = error
71+
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
72+
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
73+
74+
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = error
75+
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
76+
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
77+
78+
dotnet_naming_rule.private_field_static_readonly_should_be_pascal_case.severity = error
79+
dotnet_naming_rule.private_field_static_readonly_should_be_pascal_case.symbols = private_field_static_readonly
80+
dotnet_naming_rule.private_field_static_readonly_should_be_pascal_case.style = pascal_case
81+
82+
dotnet_naming_rule.private_field_const_should_be_pascal_case.severity = error
83+
dotnet_naming_rule.private_field_const_should_be_pascal_case.symbols = private_field_const
84+
dotnet_naming_rule.private_field_const_should_be_pascal_case.style = pascal_case
85+
86+
dotnet_naming_rule.private_field_should_begin_with_underscore.severity = error
87+
dotnet_naming_rule.private_field_should_begin_with_underscore.symbols = private_field
88+
dotnet_naming_rule.private_field_should_begin_with_underscore.style = begins_with_underscore
89+
90+
# Symbol specifications
91+
92+
dotnet_naming_symbols.interface.applicable_kinds = interface
93+
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
94+
dotnet_naming_symbols.interface.required_modifiers =
95+
96+
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
97+
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
98+
dotnet_naming_symbols.types.required_modifiers =
99+
100+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
101+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
102+
dotnet_naming_symbols.non_field_members.required_modifiers =
103+
104+
dotnet_naming_symbols.private_field_const.applicable_kinds = field
105+
dotnet_naming_symbols.private_field_const.applicable_accessibilities = private
106+
dotnet_naming_symbols.private_field_const.required_modifiers = const
107+
108+
dotnet_naming_symbols.private_field_static_readonly.applicable_kinds = field
109+
dotnet_naming_symbols.private_field_static_readonly.applicable_accessibilities = private
110+
dotnet_naming_symbols.private_field_static_readonly.required_modifiers = static, readonly
111+
112+
dotnet_naming_symbols.private_field.applicable_kinds = field
113+
dotnet_naming_symbols.private_field.applicable_accessibilities = private
114+
dotnet_naming_symbols.private_field.required_modifiers =
115+
116+
# Naming styles
117+
118+
dotnet_naming_style.pascal_case.required_prefix =
119+
dotnet_naming_style.pascal_case.required_suffix =
120+
dotnet_naming_style.pascal_case.word_separator =
121+
dotnet_naming_style.pascal_case.capitalization = pascal_case
122+
123+
dotnet_naming_style.begins_with_i.required_prefix = I
124+
dotnet_naming_style.begins_with_i.required_suffix =
125+
dotnet_naming_style.begins_with_i.word_separator =
126+
dotnet_naming_style.begins_with_i.capitalization = pascal_case
127+
128+
dotnet_naming_style.begins_with_underscore.required_prefix = _
129+
dotnet_naming_style.begins_with_underscore.required_suffix =
130+
dotnet_naming_style.begins_with_underscore.word_separator =
131+
dotnet_naming_style.begins_with_underscore.capitalization = camel_case
132+
133+
###############################
134+
# Diagnostic Conventions #
135+
###############################
136+
137+
# API1001: Action returns undeclared success result
138+
dotnet_diagnostic.API1001.severity = none
139+
140+
# CA1303: Do not pass literals as localized parameters
141+
dotnet_diagnostic.ca1303.severity = silent
142+
143+
# CA1308: Normalize strings to uppercase
144+
dotnet_diagnostic.CA1308.severity = silent
145+
146+
# CA1716: Identifiers should not match keywords
147+
dotnet_diagnostic.ca1716.severity = silent
148+
149+
# CA1812: Avoid uninstantiated internal classes
150+
dotnet_diagnostic.CA1812.severity = silent
151+
152+
# CA1819: Properties should not return arrays
153+
dotnet_diagnostic.ca1819.severity = none
154+
155+
# CA1848: Use the LoggerMessage delegates
156+
dotnet_diagnostic.CA1848.severity = silent
157+
158+
# CA2007: Consider calling ConfigureAwait on the awaited task
159+
dotnet_diagnostic.CA2007.severity = suggestion
160+
161+
# IDE0058: Expression value is never used
162+
dotnet_diagnostic.IDE0058.severity = none
163+
164+
# IDE0079: Remove unnecessary suppression
165+
dotnet_diagnostic.IDE0079.severity = none
166+
167+
###############################
168+
# C# Coding Conventions #
169+
###############################
170+
[*.cs]
171+
# var preferences
172+
csharp_style_var_for_built_in_types = false:warning
173+
csharp_style_var_when_type_is_apparent = true:warning
174+
csharp_style_var_elsewhere = false:warning
175+
176+
# Expression-bodied members
177+
csharp_style_expression_bodied_methods = false:silent
178+
csharp_style_expression_bodied_constructors = false:silent
179+
csharp_style_expression_bodied_operators = false:silent
180+
csharp_style_expression_bodied_properties = true:suggestion
181+
csharp_style_expression_bodied_indexers = true:suggestion
182+
csharp_style_expression_bodied_accessors = true:suggestion
183+
csharp_style_expression_bodied_lambdas = true:silent
184+
csharp_style_expression_bodied_local_functions = false:silent
185+
186+
# Pattern matching preferences
187+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
188+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
189+
csharp_style_prefer_switch_expression = true:suggestion
190+
191+
# Null-checking preferences
192+
csharp_style_throw_expression = true:suggestion
193+
csharp_style_conditional_delegate_call = true:suggestion
194+
195+
# Modifier preferences
196+
csharp_prefer_static_local_function = true:suggestion
197+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
198+
199+
# Expression-level preferences
200+
csharp_prefer_braces = true:suggestion
201+
csharp_style_deconstructed_variable_declaration = true:suggestion
202+
csharp_prefer_simple_default_expression = true:suggestion
203+
csharp_style_pattern_local_over_anonymous_function = true:suggestion
204+
csharp_style_inlined_variable_declaration = true:suggestion
205+
csharp_prefer_simple_using_statement = true:suggestion
206+
csharp_style_prefer_index_operator = true:suggestion
207+
csharp_style_prefer_range_operator = true:suggestion
208+
csharp_style_throw_expression = true:suggestion
209+
csharp_style_unused_value_assignment_preference = discard_variable:none
210+
csharp_style_unused_value_expression_statement_preference = discard_variable:none
211+
212+
csharp_style_namespace_declarations = block_scoped:silent
213+
csharp_style_prefer_null_check_over_type_check = true:suggestion
214+
csharp_style_prefer_local_over_anonymous_function = true:silent
215+
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
216+
csharp_style_prefer_tuple_swap = true:suggestion
217+
csharp_style_prefer_pattern_matching = true:silent
218+
csharp_style_prefer_not_pattern = true:suggestion
219+
csharp_style_prefer_extended_property_pattern = true:suggestion
220+
221+
csharp_style_allow_embedded_statements_on_same_line_experimental = true:suggestion
222+
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:suggestion
223+
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:error
224+
225+
# 'using' directive preferences
226+
csharp_using_directive_placement = outside_namespace:error
227+
228+
###############################
229+
# C# Formatting Rules #
230+
###############################
231+
232+
# New line preferences
233+
csharp_new_line_before_open_brace = all
234+
csharp_new_line_before_else = true
235+
csharp_new_line_before_catch = true
236+
csharp_new_line_before_finally = true
237+
csharp_new_line_before_members_in_object_initializers = true
238+
csharp_new_line_before_members_in_anonymous_types = true
239+
csharp_new_line_between_query_expression_clauses = true
240+
241+
# Indentation preferences
242+
csharp_indent_case_contents = true
243+
csharp_indent_switch_labels = true
244+
csharp_indent_labels = one_less_than_current
245+
csharp_indent_block_contents = true
246+
csharp_indent_braces = false
247+
csharp_indent_case_contents_when_block = false
248+
249+
# Space preferences
250+
csharp_space_after_cast = false
251+
csharp_space_after_keywords_in_control_flow_statements = true
252+
csharp_space_between_method_call_parameter_list_parentheses = false
253+
csharp_space_between_method_declaration_parameter_list_parentheses = false
254+
csharp_space_between_parentheses = false
255+
csharp_space_before_colon_in_inheritance_clause = true
256+
csharp_space_after_colon_in_inheritance_clause = true
257+
csharp_space_around_binary_operators = before_and_after
258+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
259+
csharp_space_between_method_call_name_and_opening_parenthesis = false
260+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
261+
csharp_space_after_comma = true
262+
csharp_space_after_dot = false
263+
csharp_space_after_semicolon_in_for_statement = true
264+
csharp_space_around_declaration_statements = false
265+
csharp_space_before_comma = false
266+
csharp_space_before_dot = false
267+
csharp_space_before_open_square_brackets = false
268+
csharp_space_before_semicolon_in_for_statement = false
269+
csharp_space_between_empty_square_brackets = false
270+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
271+
csharp_space_between_square_brackets = false
272+
273+
# Wrapping preferences
274+
csharp_preserve_single_line_statements = false
275+
csharp_preserve_single_line_blocks = true

.github/workflows/master-pr.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Pull Request - master
2+
3+
permissions:
4+
pull-requests: write
5+
6+
on:
7+
pull_request:
8+
branches: [ master ]
9+
paths-ignore:
10+
- '.github/**'
11+
- '.editorconfig'
12+
- '.gitignore'
13+
- '.gitattributes'
14+
- 'CONTRIBUTING.md'
15+
- 'LICENSE.txt'
16+
- 'NuGet.config'
17+
- 'README.md'
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout source
24+
uses: actions/checkout@v3
25+
- name: Setup .NET 7.0.x
26+
uses: actions/setup-dotnet@v3
27+
with:
28+
dotnet-version: '7.0.x'
29+
- name: Restore solution
30+
run: dotnet restore
31+
- name: Build solution
32+
run: dotnet build --configuration Debug --no-restore -p:ContinuousIntegrationBuild=true
33+
- name: Test solution
34+
run: dotnet test --configuration Debug --no-build -p:CollectCoverage=true -p:CoverletOutputFormat=cobertura -p:UseSourceLink=true -p:CoverletOutput=../../coverage/
35+
- name: Create code coverage summary
36+
uses: irongut/[email protected]
37+
with:
38+
filename: ./coverage/*.xml
39+
badge: true
40+
fail_below_min: true
41+
format: markdown
42+
hide_branch_rate: false
43+
hide_complexity: false
44+
indicators: true
45+
output: both
46+
thresholds: '90 95'
47+
- name: Create code coverage HTML report
48+
uses: danielpalme/[email protected]
49+
with:
50+
reports: ./coverage/*.xml
51+
targetdir: report
52+
reporttypes: HtmlInline
53+
- name: Upload code coverage HTML report as artifact
54+
uses: actions/upload-artifact@v3
55+
with:
56+
name: CodeCoverageReport
57+
path: report
58+
- name: Add code coverage summary to PR
59+
uses: marocchino/sticky-pull-request-comment@v2
60+
with:
61+
recreate: true
62+
path: code-coverage-results.md
63+
- name: Add code coverage summary to job summary
64+
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish - master
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Get version from tag (pre-release)
13+
if: 'github.event.release.prerelease'
14+
run: |
15+
VERSION=${{ github.event.release.tag_name }}
16+
echo "VERSION=${VERSION#v}" >> $GITHUB_ENV
17+
- name: Checkout source
18+
uses: actions/checkout@v3
19+
- name: Setup .NET 7.0.x
20+
uses: actions/setup-dotnet@v3
21+
with:
22+
dotnet-version: '7.0.x'
23+
- name: Restore solution
24+
run: dotnet restore
25+
- name: Build solution (pre-release)
26+
if: 'github.event.release.prerelease'
27+
run: dotnet build --configuration Release --no-restore -p:ContinuousIntegrationBuild=true -p:Version=${VERSION}
28+
- name: Build solution
29+
if: '!github.event.release.prerelease'
30+
run: dotnet build --configuration Release --no-restore -p:ContinuousIntegrationBuild=true
31+
- name: Test solution
32+
run: dotnet test --configuration Release --no-build
33+
- name: Pack NuGet package (pre-release)
34+
if: 'github.event.release.prerelease'
35+
run: dotnet pack --configuration Release --no-build -o ./output -p:Version=${VERSION}
36+
- name: Pack NuGet package
37+
if: '!github.event.release.prerelease'
38+
run: dotnet pack --configuration Release --no-build -o ./output
39+
- name: Push NuGet package
40+
run: dotnet nuget push ./output/* -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_DOZER }} --skip-duplicate

0 commit comments

Comments
 (0)