From 1eb1846f5e55831cc1cafb62e836b03ae31a726e Mon Sep 17 00:00:00 2001 From: Louis Seubert Date: Wed, 20 Mar 2024 22:57:57 +0100 Subject: [PATCH] build: add more projects for sdks Add projects for creating new sdk based msbuild projects. --- .editorconfig | 344 +++++++++++------- .forgejo/workflows/default.yml | 42 +++ .forgejo/workflows/publish.yml | 21 -- Directory.Build.props | 15 +- Directory.Build.targets | 4 + Directory.Packages.props | 4 +- Geekeey.DotNet.Build.sln | 37 ++ build.sln | 30 -- doc/CONTRIBUTING.md | 77 ++++ nuget.config | 19 + .../Geekeey.DotNet.Sdk.Tasks.csproj | 10 + src/Geekeey.DotNet.Sdk.Tasks/README.md | 1 + src/Geekeey.DotNet.Sdk.Tasks/sdk/Sdk.props | 3 + src/Geekeey.DotNet.Sdk.Tasks/sdk/Sdk.targets | 110 ++++++ src/Geekeey.DotNet.Sdk.Tasks/src/Program.cs | 8 + .../Geekeey.DotNet.Sdk.csproj | 10 + src/Geekeey.DotNet.Sdk/README.md | 1 + .../sdk/Geekeey.DotNet.Sdk.Analyzer.props | 8 + .../sdk/Geekeey.DotNet.Sdk.Analyzer.targets | 102 ++++++ .../sdk/Geekeey.DotNet.Sdk.Common.props | 43 +++ .../sdk/Geekeey.DotNet.Sdk.Common.targets | 9 + .../sdk/Geekeey.DotNet.Sdk.Repository.props | 26 ++ .../sdk/Geekeey.DotNet.Sdk.Repository.targets | 10 + src/Geekeey.DotNet.Sdk/sdk/Sdk.props | 6 + src/Geekeey.DotNet.Sdk/sdk/Sdk.targets | 6 + ...ultiTargetRoslynComponent.targets.template | 69 ++++ src/Geekeey.DotNet.Sdk/src/Program.cs | 5 + ...keey.DotNet.Common.ProjectTemplates.csproj | 40 -- .../README.md | 5 - .../Repository/.template.config/template.json | 1 - .../content/Repository/placeholder.txt | 1 - templating/README.md | 6 - 32 files changed, 831 insertions(+), 242 deletions(-) create mode 100644 .forgejo/workflows/default.yml delete mode 100644 .forgejo/workflows/publish.yml create mode 100644 Geekeey.DotNet.Build.sln delete mode 100644 build.sln create mode 100644 doc/CONTRIBUTING.md create mode 100644 nuget.config create mode 100644 src/Geekeey.DotNet.Sdk.Tasks/Geekeey.DotNet.Sdk.Tasks.csproj create mode 100644 src/Geekeey.DotNet.Sdk.Tasks/README.md create mode 100644 src/Geekeey.DotNet.Sdk.Tasks/sdk/Sdk.props create mode 100644 src/Geekeey.DotNet.Sdk.Tasks/sdk/Sdk.targets create mode 100644 src/Geekeey.DotNet.Sdk.Tasks/src/Program.cs create mode 100644 src/Geekeey.DotNet.Sdk/Geekeey.DotNet.Sdk.csproj create mode 100644 src/Geekeey.DotNet.Sdk/README.md create mode 100644 src/Geekeey.DotNet.Sdk/sdk/Geekeey.DotNet.Sdk.Analyzer.props create mode 100644 src/Geekeey.DotNet.Sdk/sdk/Geekeey.DotNet.Sdk.Analyzer.targets create mode 100644 src/Geekeey.DotNet.Sdk/sdk/Geekeey.DotNet.Sdk.Common.props create mode 100644 src/Geekeey.DotNet.Sdk/sdk/Geekeey.DotNet.Sdk.Common.targets create mode 100644 src/Geekeey.DotNet.Sdk/sdk/Geekeey.DotNet.Sdk.Repository.props create mode 100644 src/Geekeey.DotNet.Sdk/sdk/Geekeey.DotNet.Sdk.Repository.targets create mode 100644 src/Geekeey.DotNet.Sdk/sdk/Sdk.props create mode 100644 src/Geekeey.DotNet.Sdk/sdk/Sdk.targets create mode 100644 src/Geekeey.DotNet.Sdk/sdk/templates/MultiTargetRoslynComponent.targets.template create mode 100644 src/Geekeey.DotNet.Sdk/src/Program.cs delete mode 100644 templating/Geekeey.DotNet.Common.ProjectTemplates/Geekeey.DotNet.Common.ProjectTemplates.csproj delete mode 100644 templating/Geekeey.DotNet.Common.ProjectTemplates/README.md delete mode 100644 templating/Geekeey.DotNet.Common.ProjectTemplates/content/Repository/.template.config/template.json delete mode 100644 templating/Geekeey.DotNet.Common.ProjectTemplates/content/Repository/placeholder.txt delete mode 100644 templating/README.md diff --git a/.editorconfig b/.editorconfig index 7e60f9f..b6b8e92 100644 --- a/.editorconfig +++ b/.editorconfig @@ -16,7 +16,11 @@ indent_style = space indent_size = 2 indent_style = space -[*.{cs,vb}] +[nuget.config] +indent_size = 2 +indent_style = space + +[*.{cs,vb}] #### .NET Coding Conventions #### # Organize usings dotnet_separate_import_directive_groups = true @@ -68,13 +72,12 @@ dotnet_code_quality_unused_parameters = all:suggestion # Suppression preferences dotnet_remove_unnecessary_suppression_exclusions = none -[*.cs] -#### C# Coding Conventions #### +[*.cs] #### C# Coding Conventions #### # var preferences -csharp_style_var_elsewhere = false:silent -csharp_style_var_for_built_in_types = false:silent -csharp_style_var_when_type_is_apparent = false:silent +csharp_style_var_for_built_in_types = true:suggestion +csharp_style_var_when_type_is_apparent = true:suggestion +csharp_style_var_elsewhere = true:suggestion # Expression-bodied members csharp_style_expression_bodied_accessors = true:silent @@ -118,7 +121,10 @@ csharp_style_unused_value_expression_statement_preference = discard_variable:sil # 'using' directive preferences csharp_using_directive_placement = outside_namespace:silent -#### C# Formatting Rules #### +# 'namespace' preferences +csharp_style_namespace_declarations = file_scoped:warning + +[*.cs] #### C# Formatting Rules #### # New line preferences csharp_new_line_before_catch = true @@ -165,164 +171,191 @@ csharp_space_between_square_brackets = false csharp_preserve_single_line_blocks = true csharp_preserve_single_line_statements = true -#### Naming styles #### -[*.{cs,vb}] - -# Naming rules +[*.{cs,vb}] #### .NET Naming styles #### dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.severity = suggestion dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.symbols = types_and_namespaces dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.style = pascalcase +dotnet_naming_symbols.types_and_namespaces.applicable_kinds = namespace, class, struct, interface, enum +dotnet_naming_symbols.types_and_namespaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types_and_namespaces.required_modifiers = + + dotnet_naming_rule.interfaces_should_be_ipascalcase.severity = suggestion dotnet_naming_rule.interfaces_should_be_ipascalcase.symbols = interfaces dotnet_naming_rule.interfaces_should_be_ipascalcase.style = ipascalcase -dotnet_naming_rule.type_parameters_should_be_tpascalcase.severity = suggestion -dotnet_naming_rule.type_parameters_should_be_tpascalcase.symbols = type_parameters -dotnet_naming_rule.type_parameters_should_be_tpascalcase.style = tpascalcase - -dotnet_naming_rule.methods_should_be_pascalcase.severity = suggestion -dotnet_naming_rule.methods_should_be_pascalcase.symbols = methods -dotnet_naming_rule.methods_should_be_pascalcase.style = pascalcase - -dotnet_naming_rule.properties_should_be_pascalcase.severity = suggestion -dotnet_naming_rule.properties_should_be_pascalcase.symbols = properties -dotnet_naming_rule.properties_should_be_pascalcase.style = pascalcase - -dotnet_naming_rule.events_should_be_pascalcase.severity = suggestion -dotnet_naming_rule.events_should_be_pascalcase.symbols = events -dotnet_naming_rule.events_should_be_pascalcase.style = pascalcase - -dotnet_naming_rule.local_variables_should_be_camelcase.severity = suggestion -dotnet_naming_rule.local_variables_should_be_camelcase.symbols = local_variables -dotnet_naming_rule.local_variables_should_be_camelcase.style = camelcase - -dotnet_naming_rule.local_constants_should_be_camelcase.severity = suggestion -dotnet_naming_rule.local_constants_should_be_camelcase.symbols = local_constants -dotnet_naming_rule.local_constants_should_be_camelcase.style = camelcase - -dotnet_naming_rule.parameters_should_be_camelcase.severity = suggestion -dotnet_naming_rule.parameters_should_be_camelcase.symbols = parameters -dotnet_naming_rule.parameters_should_be_camelcase.style = camelcase - -dotnet_naming_rule.public_fields_should_be_pascalcase.severity = suggestion -dotnet_naming_rule.public_fields_should_be_pascalcase.symbols = public_fields -dotnet_naming_rule.public_fields_should_be_pascalcase.style = pascalcase - -dotnet_naming_rule.private_fields_should_be__camelcase.severity = suggestion -dotnet_naming_rule.private_fields_should_be__camelcase.symbols = private_fields -dotnet_naming_rule.private_fields_should_be__camelcase.style = _camelcase - -dotnet_naming_rule.private_static_fields_should_be_s_camelcase.severity = suggestion -dotnet_naming_rule.private_static_fields_should_be_s_camelcase.symbols = private_static_fields -dotnet_naming_rule.private_static_fields_should_be_s_camelcase.style = s_camelcase - -dotnet_naming_rule.public_constant_fields_should_be_pascalcase.severity = suggestion -dotnet_naming_rule.public_constant_fields_should_be_pascalcase.symbols = public_constant_fields -dotnet_naming_rule.public_constant_fields_should_be_pascalcase.style = pascalcase - -dotnet_naming_rule.private_constant_fields_should_be_pascalcase.severity = suggestion -dotnet_naming_rule.private_constant_fields_should_be_pascalcase.symbols = private_constant_fields -dotnet_naming_rule.private_constant_fields_should_be_pascalcase.style = pascalcase - -dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.severity = suggestion -dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.symbols = public_static_readonly_fields -dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.style = pascalcase - -dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.severity = suggestion -dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.symbols = private_static_readonly_fields -dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.style = pascalcase - -dotnet_naming_rule.enums_should_be_pascalcase.severity = suggestion -dotnet_naming_rule.enums_should_be_pascalcase.symbols = enums -dotnet_naming_rule.enums_should_be_pascalcase.style = pascalcase - -dotnet_naming_rule.local_functions_should_be_pascalcase.severity = suggestion -dotnet_naming_rule.local_functions_should_be_pascalcase.symbols = local_functions -dotnet_naming_rule.local_functions_should_be_pascalcase.style = pascalcase - -dotnet_naming_rule.non_field_members_should_be_pascalcase.severity = suggestion -dotnet_naming_rule.non_field_members_should_be_pascalcase.symbols = non_field_members -dotnet_naming_rule.non_field_members_should_be_pascalcase.style = pascalcase - -# Symbol specifications - dotnet_naming_symbols.interfaces.applicable_kinds = interface dotnet_naming_symbols.interfaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected dotnet_naming_symbols.interfaces.required_modifiers = + +dotnet_naming_rule.enums_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.enums_should_be_pascalcase.symbols = enums +dotnet_naming_rule.enums_should_be_pascalcase.style = pascalcase + dotnet_naming_symbols.enums.applicable_kinds = enum dotnet_naming_symbols.enums.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected dotnet_naming_symbols.enums.required_modifiers = -dotnet_naming_symbols.events.applicable_kinds = event -dotnet_naming_symbols.events.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.events.required_modifiers = -dotnet_naming_symbols.methods.applicable_kinds = method -dotnet_naming_symbols.methods.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.methods.required_modifiers = - -dotnet_naming_symbols.properties.applicable_kinds = property -dotnet_naming_symbols.properties.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.properties.required_modifiers = - -dotnet_naming_symbols.public_fields.applicable_kinds = field -dotnet_naming_symbols.public_fields.applicable_accessibilities = public, internal -dotnet_naming_symbols.public_fields.required_modifiers = - -dotnet_naming_symbols.private_fields.applicable_kinds = field -dotnet_naming_symbols.private_fields.applicable_accessibilities = private, protected, protected_internal, private_protected -dotnet_naming_symbols.private_fields.required_modifiers = - -dotnet_naming_symbols.private_static_fields.applicable_kinds = field -dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private, protected, protected_internal, private_protected -dotnet_naming_symbols.private_static_fields.required_modifiers = static - -dotnet_naming_symbols.types_and_namespaces.applicable_kinds = namespace, class, struct, interface, enum -dotnet_naming_symbols.types_and_namespaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.types_and_namespaces.required_modifiers = - -dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method -dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.non_field_members.required_modifiers = +dotnet_naming_rule.type_parameters_should_be_tpascalcase.severity = suggestion +dotnet_naming_rule.type_parameters_should_be_tpascalcase.symbols = type_parameters +dotnet_naming_rule.type_parameters_should_be_tpascalcase.style = tpascalcase dotnet_naming_symbols.type_parameters.applicable_kinds = namespace dotnet_naming_symbols.type_parameters.applicable_accessibilities = * dotnet_naming_symbols.type_parameters.required_modifiers = -dotnet_naming_symbols.private_constant_fields.applicable_kinds = field -dotnet_naming_symbols.private_constant_fields.applicable_accessibilities = private, protected, protected_internal, private_protected -dotnet_naming_symbols.private_constant_fields.required_modifiers = const -dotnet_naming_symbols.local_variables.applicable_kinds = local -dotnet_naming_symbols.local_variables.applicable_accessibilities = local -dotnet_naming_symbols.local_variables.required_modifiers = +dotnet_naming_rule.methods_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.methods_should_be_pascalcase.symbols = methods +dotnet_naming_rule.methods_should_be_pascalcase.style = pascalcase -dotnet_naming_symbols.local_constants.applicable_kinds = local -dotnet_naming_symbols.local_constants.applicable_accessibilities = local -dotnet_naming_symbols.local_constants.required_modifiers = const +dotnet_naming_symbols.methods.applicable_kinds = method +dotnet_naming_symbols.methods.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.methods.required_modifiers = + + +dotnet_naming_rule.async_methods_end_in_async.severity = suggestion +dotnet_naming_rule.async_methods_end_in_async.symbols = any_async_methods +dotnet_naming_rule.async_methods_end_in_async.style = end_in_async + +dotnet_naming_symbols.any_async_methods.applicable_kinds = method +dotnet_naming_symbols.any_async_methods.applicable_accessibilities = * +dotnet_naming_symbols.any_async_methods.required_modifiers = async + + +dotnet_naming_rule.parameters_should_be_camelcase.severity = suggestion +dotnet_naming_rule.parameters_should_be_camelcase.symbols = parameters +dotnet_naming_rule.parameters_should_be_camelcase.style = camelcase dotnet_naming_symbols.parameters.applicable_kinds = parameter dotnet_naming_symbols.parameters.applicable_accessibilities = * dotnet_naming_symbols.parameters.required_modifiers = -dotnet_naming_symbols.public_constant_fields.applicable_kinds = field -dotnet_naming_symbols.public_constant_fields.applicable_accessibilities = public, internal -dotnet_naming_symbols.public_constant_fields.required_modifiers = const -dotnet_naming_symbols.public_static_readonly_fields.applicable_kinds = field -dotnet_naming_symbols.public_static_readonly_fields.applicable_accessibilities = public, internal -dotnet_naming_symbols.public_static_readonly_fields.required_modifiers = readonly, static +dotnet_naming_rule.properties_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.properties_should_be_pascalcase.symbols = properties +dotnet_naming_rule.properties_should_be_pascalcase.style = pascalcase + +dotnet_naming_symbols.properties.applicable_kinds = property +dotnet_naming_symbols.properties.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.properties.required_modifiers = + + +dotnet_naming_rule.events_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.events_should_be_pascalcase.symbols = events +dotnet_naming_rule.events_should_be_pascalcase.style = pascalcase + +dotnet_naming_symbols.events.applicable_kinds = event +dotnet_naming_symbols.events.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.events.required_modifiers = + +# local + +dotnet_naming_rule.local_variables_should_be_camelcase.severity = suggestion +dotnet_naming_rule.local_variables_should_be_camelcase.symbols = local_variables +dotnet_naming_rule.local_variables_should_be_camelcase.style = camelcase + +dotnet_naming_symbols.local_variables.applicable_kinds = local +dotnet_naming_symbols.local_variables.applicable_accessibilities = local +dotnet_naming_symbols.local_variables.required_modifiers = + + +dotnet_naming_rule.local_functions_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.local_functions_should_be_pascalcase.symbols = local_functions +dotnet_naming_rule.local_functions_should_be_pascalcase.style = pascalcase + +dotnet_naming_symbols.local_functions.applicable_kinds = local_function +dotnet_naming_symbols.local_functions.applicable_accessibilities = * +dotnet_naming_symbols.local_functions.required_modifiers = + + +dotnet_naming_rule.local_constants_should_be_camelcase.severity = suggestion +dotnet_naming_rule.local_constants_should_be_camelcase.symbols = local_constants +dotnet_naming_rule.local_constants_should_be_camelcase.style = camelcase + +dotnet_naming_symbols.local_constants.applicable_kinds = local +dotnet_naming_symbols.local_constants.applicable_accessibilities = local +dotnet_naming_symbols.local_constants.required_modifiers = const + +# private + +dotnet_naming_rule.private_fields_should_be__camelcase.severity = suggestion +dotnet_naming_rule.private_fields_should_be__camelcase.symbols = private_fields +dotnet_naming_rule.private_fields_should_be__camelcase.style = _camelcase + +dotnet_naming_symbols.private_fields.applicable_kinds = field +dotnet_naming_symbols.private_fields.applicable_accessibilities = private, protected, protected_internal, private_protected +dotnet_naming_symbols.private_fields.required_modifiers = + + +dotnet_naming_rule.private_static_fields_should_be_s_camelcase.severity = suggestion +dotnet_naming_rule.private_static_fields_should_be_s_camelcase.symbols = private_static_fields +dotnet_naming_rule.private_static_fields_should_be_s_camelcase.style = s_camelcase + +dotnet_naming_symbols.private_static_fields.applicable_kinds = field +dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private, protected, protected_internal, private_protected +dotnet_naming_symbols.private_static_fields.required_modifiers = static + + +dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.symbols = private_static_readonly_fields +dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.style = pascalcase dotnet_naming_symbols.private_static_readonly_fields.applicable_kinds = field dotnet_naming_symbols.private_static_readonly_fields.applicable_accessibilities = private, protected, protected_internal, private_protected dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = readonly, static -dotnet_naming_symbols.local_functions.applicable_kinds = local_function -dotnet_naming_symbols.local_functions.applicable_accessibilities = * -dotnet_naming_symbols.local_functions.required_modifiers = + +dotnet_naming_rule.private_constant_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.private_constant_fields_should_be_pascalcase.symbols = private_constant_fields +dotnet_naming_rule.private_constant_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_symbols.private_constant_fields.applicable_kinds = field +dotnet_naming_symbols.private_constant_fields.applicable_accessibilities = private, protected, protected_internal, private_protected +dotnet_naming_symbols.private_constant_fields.required_modifiers = const + +# public + +dotnet_naming_rule.public_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.public_fields_should_be_pascalcase.symbols = public_fields +dotnet_naming_rule.public_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_symbols.public_fields.applicable_kinds = field +dotnet_naming_symbols.public_fields.applicable_accessibilities = public, internal +dotnet_naming_symbols.public_fields.required_modifiers = + + +dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.symbols = public_static_readonly_fields +dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_symbols.public_static_readonly_fields.applicable_kinds = field +dotnet_naming_symbols.public_static_readonly_fields.applicable_accessibilities = public, internal +dotnet_naming_symbols.public_static_readonly_fields.required_modifiers = readonly, static + + +dotnet_naming_rule.public_constant_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.public_constant_fields_should_be_pascalcase.symbols = public_constant_fields +dotnet_naming_rule.public_constant_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_symbols.public_constant_fields.applicable_kinds = field +dotnet_naming_symbols.public_constant_fields.applicable_accessibilities = public, internal +dotnet_naming_symbols.public_constant_fields.required_modifiers = const + +# others + +dotnet_naming_rule.non_field_members_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascalcase.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascalcase.style = pascalcase + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + # Naming styles @@ -355,3 +388,56 @@ dotnet_naming_style.s_camelcase.required_prefix = s_ dotnet_naming_style.s_camelcase.required_suffix = dotnet_naming_style.s_camelcase.word_separator = dotnet_naming_style.s_camelcase.capitalization = camel_case + +dotnet_naming_style.end_in_async.required_prefix = +dotnet_naming_style.end_in_async.required_suffix = Async +dotnet_naming_style.end_in_async.capitalization = pascal_case +dotnet_naming_style.end_in_async.word_separator = + +[*.{cs.vb}] +dotnet_diagnostic.IDE0055.severity = error +# IDE0051: Remove unused private member +dotnet_diagnostic.IDE0051.severity = error +# IDE0052: Remove unread private member +dotnet_diagnostic.IDE0052.severity = error +# IDE0064: Make struct fields writable +dotnet_diagnostic.IDE0064.severity = error + +dotnet_analyzer_diagnostic.severity = error +# CS1591: Missing XML comment for publicly visible type or member +dotnet_diagnostic.CS1591.severity = suggestion +# CA1018: Mark attributes with AttributeUsageAttribute +dotnet_diagnostic.CA1018.severity = error +# CA1304: Specify CultureInfo +dotnet_diagnostic.CA1304.severity = warning +# CA1802: Use literals where appropriate +dotnet_diagnostic.CA1802.severity = warning +# CA1813: Avoid unsealed attributes +dotnet_diagnostic.CA1813.severity = error +# CA1815: Override equals and operator equals on value types +dotnet_diagnostic.CA1815.severity = warning +# CA1820: Test for empty strings using string length +dotnet_diagnostic.CA1820.severity = warning +# CA1821: Remove empty finalizers +dotnet_diagnostic.CA1821.severity = warning +# CA1822: Mark members as static +dotnet_diagnostic.CA1822.severity = suggestion +# CA1823: Avoid unused private fields +dotnet_diagnostic.CA1823.severity = warning +dotnet_code_quality.CA1822.api_surface = private, internal +# CA1825: Avoid zero-length array allocations +dotnet_diagnostic.CA1825.severity = warning +# CA1826: Use property instead of Linq Enumerable method +dotnet_diagnostic.CA1826.severity = suggestion +# CA1827: Do not use Count/LongCount when Any can be used +dotnet_diagnostic.CA1827.severity = warning +# CA1828: Do not use CountAsync/LongCountAsync when AnyAsync can be used +dotnet_diagnostic.CA1828.severity = warning +# CA1829: Use Length/Count property instead of Enumerable.Count method +dotnet_diagnostic.CA1829.severity = warning +#CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters +dotnet_diagnostic.CA1847.severity = warning +#CA1854: Prefer the IDictionary.TryGetValue(TKey, out TValue) method +dotnet_diagnostic.CA1854.severity = warning +#CA2211:Non-constant fields should not be visible +dotnet_diagnostic.CA2211.severity = error diff --git a/.forgejo/workflows/default.yml b/.forgejo/workflows/default.yml new file mode 100644 index 0000000..db3cf56 --- /dev/null +++ b/.forgejo/workflows/default.yml @@ -0,0 +1,42 @@ +name: dotnet publish +on: + push: + tags: [ '[0-9]+.[0-9]+.[0-9]+' ] + branches: [ 'main', 'develop' ] + +jobs: + package: + runs-on: debian-latest + strategy: + matrix: + dotnet-version: [ '8.0' ] + container: mcr.microsoft.com/dotnet/sdk:${{ matrix.dotnet-version }} + steps: + - uses: https://git.geekeey.de/actions/checkout@1 + - name: NuGet login + shell: bash + run: | + # This token readonly and can only be used for restore + dotnet nuget update source geekeey --store-password-in-clear-text \ + --username "${{ github.actor }}" --password "${{ github.token }}" + - name: .NET pack + shell: bash + run: | + if [[ ${{ github.ref_name }} =~ [0-9]+.[0-9]+.[0-9]+ ]] + then + PROJECT_VERSION="${{ github.ref_name }}" + PROJECT_VERSION_SUFFIX="" + else + PROJECT_VERSION="1.0.0" + PROJECT_VERSION_SUFFIX="-unstable" + fi + dotnet pack -p:version="${PROJECT_VERSION}${PROJECT_VERSION_SUFFIX}" -p:ContinuousIntegrationBuild=true + - name: .NET test + shell: bash + run: | + dotnet test + - name: NuGet publish + if: ${{ github.ref_type == 'tag' }} + shell: bash + run: | + dotnet nuget push -k "${{ secrets.geekeey_package_registry }}" artifacts/package/release/shipping/*.nupkg \ No newline at end of file diff --git a/.forgejo/workflows/publish.yml b/.forgejo/workflows/publish.yml deleted file mode 100644 index 92b0720..0000000 --- a/.forgejo/workflows/publish.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: dotnet publish -on: - push: - tags: [ '[0-9]+.[0-9]+.[0-9]+' ] - -jobs: - package: - runs-on: debian-latest - strategy: - matrix: - dotnet-version: [ '8.0' ] - container: mcr.microsoft.com/dotnet/sdk:${{ matrix.dotnet-version }} - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '3.1.x' - - shell: bash - run: | - dotnet - dotnet sdk check \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 21b51b9..121d466 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,13 +1,14 @@ - true - - - - Geekeey.$(MSBuildProjectName) - Geekeey.$(MSBuildProjectName) - Geekeey.$(MSBuildProjectName) + enable + enable + true + true + + + + \ No newline at end of file diff --git a/Directory.Build.targets b/Directory.Build.targets index 0c98d16..70fd817 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,3 +1,7 @@ + + + + \ No newline at end of file diff --git a/Directory.Packages.props b/Directory.Packages.props index 1cd347c..87276e7 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -3,12 +3,12 @@ true - + - + \ No newline at end of file diff --git a/Geekeey.DotNet.Build.sln b/Geekeey.DotNet.Build.sln new file mode 100644 index 0000000..75d29b5 --- /dev/null +++ b/Geekeey.DotNet.Build.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Geekeey.DotNet.Sdk", "Geekeey.DotNet.Sdk", "{05D09A24-8E73-4CB2-882D-0212A24481E3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Geekeey.DotNet.Sdk", "src\Geekeey.DotNet.Sdk\Geekeey.DotNet.Sdk.csproj", "{1C6DD900-827D-4EC9-8487-E1EAE889DDB4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Geekeey.DotNet.Sdk.Tasks", "src\Geekeey.DotNet.Sdk.Tasks\Geekeey.DotNet.Sdk.Tasks.csproj", "{7C640477-2669-4B08-A2A8-D85F1AA73E3B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1C6DD900-827D-4EC9-8487-E1EAE889DDB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1C6DD900-827D-4EC9-8487-E1EAE889DDB4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1C6DD900-827D-4EC9-8487-E1EAE889DDB4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1C6DD900-827D-4EC9-8487-E1EAE889DDB4}.Release|Any CPU.Build.0 = Release|Any CPU + {7C640477-2669-4B08-A2A8-D85F1AA73E3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7C640477-2669-4B08-A2A8-D85F1AA73E3B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7C640477-2669-4B08-A2A8-D85F1AA73E3B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7C640477-2669-4B08-A2A8-D85F1AA73E3B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {1C6DD900-827D-4EC9-8487-E1EAE889DDB4} = {05D09A24-8E73-4CB2-882D-0212A24481E3} + {7C640477-2669-4B08-A2A8-D85F1AA73E3B} = {05D09A24-8E73-4CB2-882D-0212A24481E3} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {8EA8831A-E957-4B4A-9EE3-F9A9746ED37E} + EndGlobalSection +EndGlobal diff --git a/build.sln b/build.sln deleted file mode 100644 index 54abae2..0000000 --- a/build.sln +++ /dev/null @@ -1,30 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.5.002.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "templating", "templating", "{05D09A24-8E73-4CB2-882D-0212A24481E3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Geekeey.DotNet.Common.ProjectTemplates", "templating\Geekeey.DotNet.Common.ProjectTemplates\Geekeey.DotNet.Common.ProjectTemplates.csproj", "{9FEDD1F6-3694-42F4-8472-E0161201DF9A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9FEDD1F6-3694-42F4-8472-E0161201DF9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9FEDD1F6-3694-42F4-8472-E0161201DF9A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9FEDD1F6-3694-42F4-8472-E0161201DF9A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9FEDD1F6-3694-42F4-8472-E0161201DF9A}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {9FEDD1F6-3694-42F4-8472-E0161201DF9A} = {05D09A24-8E73-4CB2-882D-0212A24481E3} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {8EA8831A-E957-4B4A-9EE3-F9A9746ED37E} - EndGlobalSection -EndGlobal diff --git a/doc/CONTRIBUTING.md b/doc/CONTRIBUTING.md new file mode 100644 index 0000000..9ac48c9 --- /dev/null +++ b/doc/CONTRIBUTING.md @@ -0,0 +1,77 @@ + +## Commit Message Guidelines + +We have very precise rules over how our git commit messages can be formatted. This leads to **more +readable messages** that are easy to follow when looking through the **project history**. But also, +we use the git commit messages to **generate the Angular change log**. + +### Commit Message Format + +Each commit message consists of a **header**, a **body** and a **footer**. The header has a special +format that includes a **type**, a **scope** and a **subject**: + +``` +(): + + + +