Skip to content

Commit ccccbfc

Browse files
authored
Merge pull request #3 from codez-one/feature/2.0
+semver: major
2 parents 6f03c36 + 1b7b431 commit ccccbfc

24 files changed

+555
-326
lines changed

.config/dotnet-tools.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"gitversion.tool": {
6+
"version": "5.8.1",
7+
"commands": [
8+
"dotnet-gitversion"
9+
]
10+
}
11+
}
12+
}

.devcontainer/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/dotnet/.devcontainer/base.Dockerfile
2+
3+
# [Choice] .NET version: 6.0, 5.0, 3.1, 6.0-bullseye, 5.0-bullseye, 3.1-bullseye, 6.0-focal, 5.0-focal, 3.1-focal
4+
ARG VARIANT="6.0-bullseye-slim"
5+
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT}
6+
7+
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
8+
ARG NODE_VERSION="none"
9+
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
10+
11+
# [Optional] Uncomment this section to install additional OS packages.
12+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
13+
# && apt-get -y install --no-install-recommends <your-package-list-here>
14+
15+
# [Optional] Uncomment this line to install global node packages.
16+
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

.devcontainer/devcontainer.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/dotnet
3+
{
4+
"name": "C# (.NET)",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
"args": {
8+
// Update 'VARIANT' to pick a .NET Core version: 3.1, 5.0, 6.0
9+
// Append -bullseye or -focal to pin to an OS version.
10+
"VARIANT": "6.0",
11+
// Options
12+
"NODE_VERSION": "lts/*"
13+
}
14+
},
15+
16+
// Set *default* container specific settings.json values on container create.
17+
"settings": {},
18+
19+
// Add the IDs of extensions you want installed when the container is created.
20+
"extensions": [
21+
"ms-dotnettools.csharp"
22+
],
23+
24+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
25+
// "forwardPorts": [5000, 5001],
26+
27+
// [Optional] To reuse of your local HTTPS dev cert:
28+
//
29+
// 1. Export it locally using this command:
30+
// * Windows PowerShell:
31+
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "$env:USERPROFILE/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
32+
// * macOS/Linux terminal:
33+
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "${HOME}/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
34+
//
35+
// 2. Uncomment these 'remoteEnv' lines:
36+
// "remoteEnv": {
37+
// "ASPNETCORE_Kestrel__Certificates__Default__Password": "SecurePwdGoesHere",
38+
// "ASPNETCORE_Kestrel__Certificates__Default__Path": "/home/vscode/.aspnet/https/aspnetapp.pfx",
39+
// },
40+
//
41+
// 3. Do one of the following depending on your scenario:
42+
// * When using GitHub Codespaces and/or Remote - Containers:
43+
// 1. Start the container
44+
// 2. Drag ~/.aspnet/https/aspnetapp.pfx into the root of the file explorer
45+
// 3. Open a terminal in VS Code and run "mkdir -p /home/vscode/.aspnet/https && mv aspnetapp.pfx /home/vscode/.aspnet/https"
46+
//
47+
// * If only using Remote - Containers with a local container, uncomment this line instead:
48+
// "mounts": [ "source=${env:HOME}${env:USERPROFILE}/.aspnet/https,target=/home/vscode/.aspnet/https,type=bind" ],
49+
50+
// Use 'postCreateCommand' to run commands after the container is created.
51+
// "postCreateCommand": "dotnet restore",
52+
53+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
54+
"remoteUser": "vscode",
55+
"features": {
56+
"powershell": "latest"
57+
}
58+
}

.editorconfig

Lines changed: 95 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Version: 1.3.2 (Using https://semver.org/)
2-
# Updated: 2019-08-04
1+
# Version: 4.0.0 (Using https://semver.org/)
2+
# Updated: 2021-10-12
33
# See https://github.com/RehanSaeed/EditorConfig/releases for release notes.
44
# See https://github.com/RehanSaeed/EditorConfig for updates to this file.
55
# See http://EditorConfig.org for more information about .editorconfig files.
@@ -28,15 +28,15 @@ trim_trailing_whitespace = true
2828
indent_style = tab
2929

3030
# Visual Studio XML Project Files
31-
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
31+
[*.{csproj,vbproj,vcxproj.filters,proj,projitems,shproj}]
3232
indent_size = 2
3333

34-
# Various XML Configuration Files
34+
# XML Configuration Files
3535
[*.{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct}]
3636
indent_size = 2
3737

3838
# JSON Files
39-
[*.{json,json5}]
39+
[*.{json,json5,webmanifest}]
4040
indent_size = 2
4141

4242
# YAML Files
@@ -48,7 +48,7 @@ indent_size = 2
4848
trim_trailing_whitespace = false
4949

5050
# Web Files
51-
[*.{htm,html,js,ts,tsx,css,sass,scss,less,svg,vue}]
51+
[*.{htm,html,js,jsm,ts,tsx,cjs,cts,ctsx,mjs,mts,mtsx,css,sass,scss,less,pcss,svg,vue}]
5252
indent_size = 2
5353

5454
# Batch Files
@@ -59,69 +59,81 @@ end_of_line = crlf
5959
[*.sh]
6060
end_of_line = lf
6161

62+
# Makefiles
63+
[Makefile]
64+
indent_style = tab
65+
6266
##########################################
63-
# .NET Language Conventions
64-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions
67+
# Default .NET Code Style Severities
68+
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/configuration-options#scope
6569
##########################################
6670

67-
# .NET Code Style Settings
68-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#net-code-style-settings
69-
[*.{cs,csx,cake,vb}]
71+
[*.{cs,csx,cake,vb,vbx}]
72+
# Default Severity for all .NET Code Style rules below
73+
dotnet_analyzer_diagnostic.severity = warning
74+
75+
##########################################
76+
# Language Rules
77+
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/language-rules
78+
##########################################
79+
80+
# .NET Style Rules
81+
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/language-rules#net-style-rules
82+
[*.{cs,csx,cake,vb,vbx}]
7083
# "this." and "Me." qualifiers
71-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#this-and-me
7284
dotnet_style_qualification_for_field = true:warning
7385
dotnet_style_qualification_for_property = true:warning
7486
dotnet_style_qualification_for_method = true:warning
7587
dotnet_style_qualification_for_event = true:warning
7688
# Language keywords instead of framework type names for type references
77-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#language-keywords
7889
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
7990
dotnet_style_predefined_type_for_member_access = true:warning
8091
# Modifier preferences
81-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#normalize-modifiers
8292
dotnet_style_require_accessibility_modifiers = always:warning
83-
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
84-
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async
93+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:warning
94+
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:warning
8595
dotnet_style_readonly_field = true:warning
8696
# Parentheses preferences
87-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#parentheses-preferences
8897
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning
8998
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning
9099
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning
91-
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion
100+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:warning
92101
# Expression-level preferences
93-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-level-preferences
94102
dotnet_style_object_initializer = true:warning
95103
dotnet_style_collection_initializer = true:warning
96104
dotnet_style_explicit_tuple_names = true:warning
97105
dotnet_style_prefer_inferred_tuple_names = true:warning
98106
dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning
99107
dotnet_style_prefer_auto_properties = true:warning
100-
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
101108
dotnet_style_prefer_conditional_expression_over_assignment = false:suggestion
109+
dotnet_diagnostic.IDE0045.severity = suggestion
102110
dotnet_style_prefer_conditional_expression_over_return = false:suggestion
111+
dotnet_diagnostic.IDE0046.severity = suggestion
103112
dotnet_style_prefer_compound_assignment = true:warning
113+
dotnet_style_prefer_simplified_interpolation = true:warning
114+
dotnet_style_prefer_simplified_boolean_expressions = true:warning
104115
# Null-checking preferences
105-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#null-checking-preferences
106116
dotnet_style_coalesce_expression = true:warning
107117
dotnet_style_null_propagation = true:warning
108-
# Parameter preferences
109-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#parameter-preferences
110-
dotnet_code_quality_unused_parameters = all:warning
111-
# More style options (Undocumented)
112-
# https://github.com/MicrosoftDocs/visualstudio-docs/issues/3641
113-
dotnet_style_operator_placement_when_wrapping = end_of_line
114-
115-
# C# Code Style Settings
116-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#c-code-style-settings
118+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
119+
# File header preferences
120+
# file_header_template = <copyright file="{fileName}" company="PROJECT-AUTHOR">\n© PROJECT-AUTHOR\n</copyright>
121+
# If you use StyleCop, you'll need to disable SA1636: File header copyright text should match.
122+
# dotnet_diagnostic.SA1636.severity = none
123+
# Undocumented
124+
dotnet_style_operator_placement_when_wrapping = end_of_line:warning
125+
csharp_style_prefer_null_check_over_type_check = true:warning
126+
dotnet_style_namespace_match_folder = true:suggestion
127+
dotnet_diagnostic.IDE0130.severity = suggestion
128+
129+
# C# Style Rules
130+
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/language-rules#c-style-rules
117131
[*.{cs,csx,cake}]
118-
# Implicit and explicit types
119-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#implicit-and-explicit-types
132+
# 'var' preferences
120133
csharp_style_var_for_built_in_types = true:warning
121134
csharp_style_var_when_type_is_apparent = true:warning
122135
csharp_style_var_elsewhere = true:warning
123136
# Expression-bodied members
124-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-bodied-members
125137
csharp_style_expression_bodied_methods = true:warning
126138
csharp_style_expression_bodied_constructors = true:warning
127139
csharp_style_expression_bodied_operators = true:warning
@@ -130,47 +142,66 @@ csharp_style_expression_bodied_indexers = true:warning
130142
csharp_style_expression_bodied_accessors = true:warning
131143
csharp_style_expression_bodied_lambdas = true:warning
132144
csharp_style_expression_bodied_local_functions = true:warning
133-
# Pattern matching
134-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#pattern-matching
145+
# Pattern matching preferences
135146
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
136147
csharp_style_pattern_matching_over_as_with_null_check = true:warning
137-
# Inlined variable declarations
138-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#inlined-variable-declarations
139-
csharp_style_inlined_variable_declaration = true:warning
148+
csharp_style_prefer_switch_expression = true:warning
149+
csharp_style_prefer_pattern_matching = true:warning
150+
csharp_style_prefer_not_pattern = true:warning
140151
# Expression-level preferences
141-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-level-preferences
152+
csharp_style_inlined_variable_declaration = true:warning
142153
csharp_prefer_simple_default_expression = true:warning
154+
csharp_style_pattern_local_over_anonymous_function = true:warning
155+
csharp_style_deconstructed_variable_declaration = true:warning
156+
csharp_style_prefer_index_operator = true:warning
157+
csharp_style_prefer_range_operator = true:warning
158+
csharp_style_implicit_object_creation_when_type_is_apparent = true:warning
143159
# "Null" checking preferences
144-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#c-null-checking-preferences
145160
csharp_style_throw_expression = true:warning
146161
csharp_style_conditional_delegate_call = true:warning
147162
# Code block preferences
148-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#code-block-preferences
149163
csharp_prefer_braces = true:warning
150-
# Unused value preferences
151-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#unused-value-preferences
152-
csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion
153-
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
154-
# Index and range preferences
155-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#index-and-range-preferences
156-
csharp_style_prefer_index_operator = true:warning
157-
csharp_style_prefer_range_operator = true:warning
158-
# Miscellaneous preferences
159-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#miscellaneous-preferences
160-
csharp_style_deconstructed_variable_declaration = true:warning
161-
csharp_style_pattern_local_over_anonymous_function = true:warning
164+
csharp_prefer_simple_using_statement = true:suggestion
165+
dotnet_diagnostic.IDE0063.severity = suggestion
166+
# 'using' directive preferences
162167
csharp_using_directive_placement = inside_namespace:warning
168+
# Modifier preferences
163169
csharp_prefer_static_local_function = true:warning
164-
csharp_prefer_simple_using_statement = false:warning
170+
# Undocumented
171+
csharp_style_namespace_declarations = file_scoped:warning
165172

166173
##########################################
167-
# .NET Formatting Conventions
168-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-code-style-settings-reference#formatting-conventions
174+
# Unnecessary Code Rules
175+
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/unnecessary-code-rules
169176
##########################################
170177

171-
# Organize usings
172-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#organize-using-directives
178+
# .NET Unnecessary code rules
179+
[*.{cs,csx,cake,vb,vbx}]
180+
dotnet_code_quality_unused_parameters = all:warning
181+
dotnet_remove_unnecessary_suppression_exclusions = none:warning
182+
183+
# C# Unnecessary code rules
184+
[*.{cs,csx,cake}]
185+
csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion
186+
dotnet_diagnostic.IDE0058.severity = suggestion
187+
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
188+
dotnet_diagnostic.IDE0059.severity = suggestion
189+
190+
##########################################
191+
# Formatting Rules
192+
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules
193+
##########################################
194+
195+
# .NET formatting rules
196+
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#net-formatting-rules
197+
[*.{cs,csx,cake,vb,vbx}]
198+
# Organize using directives
173199
dotnet_sort_system_directives_first = true
200+
dotnet_separate_import_directive_groups = false
201+
202+
# C# formatting rules
203+
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#c-formatting-rules
204+
[*.{cs,csx,cake}]
174205
# Newline options
175206
# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#new-line-options
176207
csharp_new_line_before_open_brace = all
@@ -212,17 +243,17 @@ csharp_space_around_declaration_statements = false
212243
csharp_space_before_open_square_brackets = false
213244
csharp_space_between_empty_square_brackets = false
214245
csharp_space_between_square_brackets = false
215-
# Wrapping options
246+
# Wrap options
216247
# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#wrap-options
217248
csharp_preserve_single_line_statements = false
218249
csharp_preserve_single_line_blocks = true
219250

220251
##########################################
221-
# .NET Naming Conventions
222-
# https://docs.microsoft.com/visualstudio/ide/editorconfig-naming-conventions
252+
# .NET Naming Rules
253+
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/naming-rules
223254
##########################################
224255

225-
[*.{cs,csx,cake,vb}]
256+
[*.{cs,csx,cake,vb,vbx}]
226257

227258
##########################################
228259
# Styles
@@ -244,7 +275,7 @@ dotnet_naming_style.prefix_type_parameters_with_t_style.required_prefix = T
244275
dotnet_naming_style.disallowed_style.capitalization = pascal_case
245276
dotnet_naming_style.disallowed_style.required_prefix = ____RULE_VIOLATION____
246277
dotnet_naming_style.disallowed_style.required_suffix = ____RULE_VIOLATION____
247-
# internal_error_style - This style should never occur... if it does, it's indicates a bug in file or in the parser using the file
278+
# internal_error_style - This style should never occur... if it does, it indicates a bug in file or in the parser using the file
248279
dotnet_naming_style.internal_error_style.capitalization = pascal_case
249280
dotnet_naming_style.internal_error_style.required_prefix = ____INTERNAL_ERROR____
250281
dotnet_naming_style.internal_error_style.required_suffix = ____INTERNAL_ERROR____
@@ -414,4 +445,4 @@ dotnet_naming_rule.parameters_rule.severity = warning
414445
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
415446
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
416447
# OTHER DEALINGS IN THE SOFTWARE.
417-
##########################################
448+
##########################################

0 commit comments

Comments
 (0)