Skip to content

Commit 1bdab1c

Browse files
author
Kirsten Kluge
committed
Initial 2.0 commit
- Update to dotnet 6 - Update to the new minimal API model - Update the Azure packages - Update Build pipeline - Update GitVersion - Remove Gitversion script, insteed make use of the dotnet tool version - Add route for /config and /config.json - Update Editor Config - Add Azure template for easy sample deployment +semver: major
1 parent 6f03c36 commit 1bdab1c

21 files changed

+472
-324
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+
}

.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+
##########################################

.vscode/launch.json

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
{
2-
// Use IntelliSense to find out which attributes exist for C# debugging
3-
// Use hover for the description of the existing attributes
4-
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
5-
"version": "0.2.0",
6-
"configurations": [
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
77
{
88
"name": ".NET Core Launch (web)",
99
"type": "coreclr",
1010
"request": "launch",
1111
"preLaunchTask": "build",
12-
// If you have changed target frameworks, make sure to update the program path.
13-
"program": "${workspaceFolder}/src/EasyConfig.SiteExtension/bin/Debug/netcoreapp3.0/EasyConfig.SiteExtension.dll",
12+
"program": "${workspaceFolder}/src/EasyConfig.SiteExtension/bin/Debug/net6.0/EasyConfig.SiteExtension.dll",
1413
"args": [],
1514
"cwd": "${workspaceFolder}/src/EasyConfig.SiteExtension",
1615
"stopAtEntry": false,
17-
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
1816
"serverReadyAction": {
1917
"action": "openExternally",
20-
"pattern": "^\\s*Now listening on:\\s+(https?://\\S+)"
18+
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
2119
},
2220
"env": {
2321
"ASPNETCORE_ENVIRONMENT": "Development",
@@ -36,8 +34,7 @@
3634
{
3735
"name": ".NET Core Attach",
3836
"type": "coreclr",
39-
"request": "attach",
40-
"processId": "${command:pickProcess}"
37+
"request": "attach"
4138
}
4239
]
4340
}

.vscode/tasks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"tasks": [
44
{
55
"label": "build",
6-
"command": "dotnet",
7-
"type": "process",
86
"group": {
97
"kind": "build",
108
"isDefault": true
119
},
10+
"command": "dotnet",
11+
"type": "process",
1212
"args": [
1313
"build",
1414
"${workspaceFolder}/src/EasyConfig.SiteExtension/EasyConfig.SiteExtension.csproj",

GitVersion.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ minor-version-bump-message: '\+semver:\s?(feature|minor)'
66
patch-version-bump-message: '\+semver:\s?(fix|patch)'
77
no-bump-message: '\+semver:\s?(none|skip)'
88
commit-message-incrementing: Enabled
9+
update-build-number: false
910
ignore:
1011
sha: []

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
> provided by [codez.one](https://codez.one)
44
5+
[![Deploy To Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fcodez-one%2FEasyConfig%2Fmaster%2Fazure%2Fazuredeploy.json)
6+
57
## Introduction
68

79
An endpoint for SPA client apps hosted in an Azure Web App to get configuration values stored in environment variables or Azure KeyVault.

0 commit comments

Comments
 (0)