Skip to content

Commit 1236675

Browse files
BenjaminAbtgfoidl
andauthored
add init (#1)
* add init * add bot tests * add regex map * Apply suggestions from code review Co-authored-by: Günther Foidl <[email protected]> * add memory cache implementation * add regex * remove custom * add factories * remove redirect * fix naming * add cache feedback * add feedback * remove doubled ctor * add feedback * add docs * add feedback * add code cleanup * add docs * add docs * add feedback * add docs * add auto cleanup editconfig * add feedback * add tests * add tests * add tests * add tests * add tests * add cicd * add feedback * add nuget stuff * add docs * add benchmark * add benchmark * add benchmarks * fix doc Co-authored-by: Günther Foidl <[email protected]>
1 parent 8c915aa commit 1236675

File tree

50 files changed

+2896
-1
lines changed

Some content is hidden

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

50 files changed

+2896
-1
lines changed

.editorconfig

+240
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
# Remove the line below if you want to inherit .editorconfig settings from higher directories
2+
root = true
3+
4+
# all files
5+
[*]
6+
7+
charset = utf-8
8+
9+
# Indentation and spacing
10+
indent_style = space
11+
indent_size = 4
12+
tab_width = 4
13+
14+
# New line preferences
15+
end_of_line = lf
16+
insert_final_newline = true
17+
trim_trailing_whitespace = true
18+
19+
# C# files
20+
[*.cs]
21+
22+
file_header_template = Copyright © myCSharp 2020-2021, all rights reserved
23+
24+
#### .NET Coding Conventions ####
25+
26+
# Organize usings
27+
dotnet_separate_import_directive_groups = false
28+
dotnet_sort_system_directives_first = true
29+
30+
# this. and Me. preferences
31+
dotnet_style_qualification_for_event = true:suggestion
32+
dotnet_style_qualification_for_field = false:suggestion
33+
dotnet_style_qualification_for_method = true:suggestion
34+
dotnet_style_qualification_for_property = true:suggestion
35+
36+
# Language keywords vs BCL types preferences
37+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
38+
dotnet_style_predefined_type_for_member_access = true:suggestion
39+
40+
# Parentheses preferences
41+
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:silent
42+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
43+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
44+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
45+
46+
# Modifier preferences
47+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
48+
49+
# Expression-level preferences
50+
csharp_style_deconstructed_variable_declaration = true:suggestion
51+
csharp_style_inlined_variable_declaration = true:suggestion
52+
csharp_style_throw_expression = true:suggestion
53+
dotnet_style_coalesce_expression = true:suggestion
54+
dotnet_style_collection_initializer = true:suggestion
55+
dotnet_style_explicit_tuple_names = true:suggestion
56+
dotnet_style_null_propagation = true:suggestion
57+
dotnet_style_object_initializer = true:suggestion
58+
dotnet_style_prefer_auto_properties = true:silent
59+
dotnet_style_prefer_compound_assignment = true:suggestion
60+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
61+
dotnet_style_prefer_conditional_expression_over_return = true:silent
62+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
63+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
64+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
65+
66+
# Field preferences
67+
dotnet_style_readonly_field = true:suggestion
68+
69+
# Parameter preferences
70+
dotnet_code_quality_unused_parameters = all:suggestion
71+
72+
#### C# Coding Conventions ####
73+
74+
# var preferences
75+
csharp_style_var_elsewhere = false:silent
76+
csharp_style_var_for_built_in_types = false:silent
77+
csharp_style_var_when_type_is_apparent = true:silent
78+
79+
# Expression-bodied members
80+
csharp_style_expression_bodied_accessors = true:silent
81+
csharp_style_expression_bodied_constructors = true:silent
82+
csharp_style_expression_bodied_indexers = true:silent
83+
csharp_style_expression_bodied_lambdas = true:silent
84+
csharp_style_expression_bodied_local_functions = true:silent
85+
csharp_style_expression_bodied_methods = true:silent
86+
csharp_style_expression_bodied_operators = true:silent
87+
csharp_style_expression_bodied_properties = true:silent
88+
89+
# Pattern matching preferences
90+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
91+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
92+
csharp_style_prefer_switch_expression = true:suggestion
93+
94+
# Null-checking preferences
95+
csharp_style_conditional_delegate_call = true:suggestion
96+
97+
# Modifier preferences
98+
csharp_prefer_static_local_function = true:suggestion
99+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
100+
101+
# Code-block preferences
102+
csharp_prefer_braces = false:silent
103+
csharp_prefer_simple_using_statement = true:suggestion
104+
105+
# Expression-level preferences
106+
csharp_prefer_simple_default_expression = true:suggestion
107+
csharp_style_pattern_local_over_anonymous_function = true:suggestion
108+
csharp_style_prefer_index_operator = true:suggestion
109+
csharp_style_prefer_range_operator = true:suggestion
110+
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
111+
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
112+
113+
# 'using' directive preferences
114+
csharp_using_directive_placement = outside_namespace:silent
115+
116+
#### C# Formatting Rules ####
117+
118+
# New line preferences
119+
csharp_new_line_before_catch = true
120+
csharp_new_line_before_else = true
121+
csharp_new_line_before_finally = true
122+
csharp_new_line_before_members_in_anonymous_types = true
123+
csharp_new_line_before_members_in_object_initializers = true
124+
csharp_new_line_before_open_brace = all
125+
csharp_new_line_between_query_expression_clauses = true
126+
127+
# Indentation preferences
128+
csharp_indent_block_contents = true
129+
csharp_indent_braces = false
130+
csharp_indent_case_contents = true
131+
csharp_indent_case_contents_when_block = true
132+
csharp_indent_labels = one_less_than_current
133+
csharp_indent_switch_labels = true
134+
135+
# Space preferences
136+
csharp_space_after_cast = false
137+
csharp_space_after_colon_in_inheritance_clause = true
138+
csharp_space_after_comma = true
139+
csharp_space_after_dot = false
140+
csharp_space_after_keywords_in_control_flow_statements = true
141+
csharp_space_after_semicolon_in_for_statement = true
142+
csharp_space_around_binary_operators = before_and_after
143+
csharp_space_around_declaration_statements = false
144+
csharp_space_before_colon_in_inheritance_clause = true
145+
csharp_space_before_comma = false
146+
csharp_space_before_dot = false
147+
csharp_space_before_open_square_brackets = false
148+
csharp_space_before_semicolon_in_for_statement = false
149+
csharp_space_between_empty_square_brackets = false
150+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
151+
csharp_space_between_method_call_name_and_opening_parenthesis = false
152+
csharp_space_between_method_call_parameter_list_parentheses = false
153+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
154+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
155+
csharp_space_between_method_declaration_parameter_list_parentheses = false
156+
csharp_space_between_parentheses = false
157+
csharp_space_between_square_brackets = false
158+
159+
# Wrapping preferences
160+
csharp_preserve_single_line_blocks = true
161+
csharp_preserve_single_line_statements = true
162+
163+
#### Naming styles ####
164+
165+
# Naming rules
166+
167+
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
168+
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
169+
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
170+
171+
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
172+
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
173+
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
174+
175+
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
176+
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
177+
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
178+
179+
dotnet_naming_rule.constant_should_be_pascal_case.severity = suggestion
180+
dotnet_naming_rule.constant_should_be_pascal_case.symbols = constant
181+
dotnet_naming_rule.constant_should_be_pascal_case.style = pascal_case
182+
183+
dotnet_naming_rule.private_or_internal_static_field_should_be_static_field.severity = suggestion
184+
dotnet_naming_rule.private_or_internal_static_field_should_be_static_field.symbols = private_or_internal_static_field
185+
dotnet_naming_rule.private_or_internal_static_field_should_be_static_field.style = static_field
186+
187+
dotnet_naming_rule.private_or_internal_field_should_be_instance_field.severity = suggestion
188+
dotnet_naming_rule.private_or_internal_field_should_be_instance_field.symbols = private_or_internal_field
189+
dotnet_naming_rule.private_or_internal_field_should_be_instance_field.style = instance_field
190+
191+
# Symbol specifications
192+
193+
dotnet_naming_symbols.interface.applicable_kinds = interface
194+
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
195+
dotnet_naming_symbols.interface.required_modifiers =
196+
197+
dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field
198+
dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected
199+
dotnet_naming_symbols.private_or_internal_field.required_modifiers =
200+
201+
dotnet_naming_symbols.private_or_internal_static_field.applicable_kinds = field
202+
dotnet_naming_symbols.private_or_internal_static_field.applicable_accessibilities = internal, private, private_protected
203+
dotnet_naming_symbols.private_or_internal_static_field.required_modifiers = static
204+
205+
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
206+
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
207+
dotnet_naming_symbols.types.required_modifiers =
208+
209+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
210+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
211+
dotnet_naming_symbols.non_field_members.required_modifiers =
212+
213+
dotnet_naming_symbols.constant.applicable_kinds = field
214+
dotnet_naming_symbols.constant.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
215+
dotnet_naming_symbols.constant.required_modifiers = const
216+
217+
# Naming styles
218+
219+
dotnet_naming_style.pascal_case.required_prefix =
220+
dotnet_naming_style.pascal_case.required_suffix =
221+
dotnet_naming_style.pascal_case.word_separator =
222+
dotnet_naming_style.pascal_case.capitalization = pascal_case
223+
224+
dotnet_naming_style.begins_with_i.required_prefix = I
225+
dotnet_naming_style.begins_with_i.required_suffix =
226+
dotnet_naming_style.begins_with_i.word_separator =
227+
dotnet_naming_style.begins_with_i.capitalization = pascal_case
228+
229+
dotnet_naming_style.static_field.required_prefix = s_
230+
dotnet_naming_style.static_field.required_suffix =
231+
dotnet_naming_style.static_field.word_separator =
232+
dotnet_naming_style.static_field.capitalization = camel_case
233+
234+
dotnet_naming_style.instance_field.required_prefix = _
235+
dotnet_naming_style.instance_field.required_suffix =
236+
dotnet_naming_style.instance_field.word_separator =
237+
dotnet_naming_style.instance_field.capitalization = camel_case
238+
239+
# RCS1096: Convert 'HasFlag' call to bitwise operation (or vice versa).
240+
dotnet_diagnostic.RCS1096.severity = none

.github/workflows/ci.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: NETCore
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types: [closed]
9+
branches:
10+
- master
11+
12+
env:
13+
BuildConfig: Release
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
22+
23+
- uses: dotnet/nbgv@master # https://github.com/dotnet/nbgv
24+
id: nbgv
25+
26+
- name: Versioning
27+
run: echo ${{ steps.nbgv.outputs.SemVer2 }}
28+
29+
- name: Build with dotnet
30+
run: dotnet build
31+
--configuration ${{ env.BuildConfig }}
32+
/p:Version=${{ steps.nbgv.outputs.AssemblyVersion }}
33+
34+
- name: Test with dotnet
35+
run: dotnet test
36+
37+
- name: Pack NuGet
38+
run: dotnet pack
39+
--configuration ${{ env.BuildConfig }}
40+
/p:Version=${{ steps.nbgv.outputs.NuGetPackageVersion }}
41+
42+
- name: Push to NuGet
43+
run: dotnet nuget push **/*.nupkg
44+
--api-key ${{ secrets.NUGET_DEPLOY_KEY }}
45+
--source https://api.nuget.org/v3/index.json
46+
--no-symbols 1

0 commit comments

Comments
 (0)