From 12ead65f3c4cc358f0939bc2ba2b03c3d00896f2 Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Sun, 18 Feb 2024 11:01:42 +1100 Subject: [PATCH] housekeeping: Remove cake, update packages, use central nuget --- .editorconfig | 411 +++++++++++++++++- azure-pipelines.yml | 19 - build.cake | 26 -- build.cmd | 2 - build.config | 2 - build.ps1 | 112 ----- build.sh | 51 --- cake.config | 7 - src/Directory.Packages.props | 27 ++ src/Directory.build.props | 59 ++- .../System.Reactive.Wasm.Tests.csproj | 2 +- .../ConcurrencyAbstractionLayerWasmImpl.cs | 21 +- ...PlatformEnlightenmentProviderExtensions.cs | 6 +- .../Internal/StopwatchImpl.cs | 2 +- src/System.Reactive.Wasm/Internal/Stubs.cs | 2 +- .../Internal/TimerStubs.cs | 2 +- .../WasmPlatformEnlightenmentProvider.cs | 9 +- .../Internal/WasmScheduler.cs | 14 +- .../System.Reactive.Wasm.csproj | 9 +- src/stylecop.json | 4 +- 20 files changed, 475 insertions(+), 312 deletions(-) delete mode 100644 azure-pipelines.yml delete mode 100644 build.cake delete mode 100644 build.cmd delete mode 100644 build.config delete mode 100644 build.ps1 delete mode 100755 build.sh delete mode 100644 cake.config create mode 100644 src/Directory.Packages.props diff --git a/.editorconfig b/.editorconfig index 8a7cddf..72321bc 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,6 +10,39 @@ root = true insert_final_newline = true indent_style = space indent_size = 4 +dotnet_diagnostic.CA1027.severity=error +dotnet_diagnostic.CA1062.severity=error +dotnet_diagnostic.CA1064.severity=error +dotnet_diagnostic.CA1066.severity=error +dotnet_diagnostic.CA1067.severity=error +dotnet_diagnostic.CA1068.severity=error +dotnet_diagnostic.CA1069.severity=warning +dotnet_diagnostic.CA2013.severity=error +dotnet_diagnostic.CA1802.severity=error +dotnet_diagnostic.CA1813.severity=error +dotnet_diagnostic.CA1814.severity=error +dotnet_diagnostic.CA1815.severity=error +dotnet_diagnostic.CA1822.severity=error +dotnet_diagnostic.CA1827.severity=error +dotnet_diagnostic.CA1828.severity=error +dotnet_diagnostic.CA1826.severity=error +dotnet_diagnostic.CA1829.severity=error +dotnet_diagnostic.CA1830.severity=error +dotnet_diagnostic.CA1831.severity=error +dotnet_diagnostic.CA1832.severity=error +dotnet_diagnostic.CA1833.severity=error +dotnet_diagnostic.CA1834.severity=error +dotnet_diagnostic.CA1835.severity=error +dotnet_diagnostic.CA1836.severity=error +dotnet_diagnostic.CA1837.severity=error +dotnet_diagnostic.CA1838.severity=error +dotnet_diagnostic.CA2015.severity=error +dotnet_diagnostic.CA2012.severity=error +dotnet_diagnostic.CA2011.severity=error +dotnet_diagnostic.CA2009.severity=error +dotnet_diagnostic.CA2008.severity=error +dotnet_diagnostic.CA2007.severity=warning +dotnet_diagnostic.CA2000.severity=suggestion [project.json] indent_size = 2 @@ -29,9 +62,13 @@ csharp_new_line_between_query_expression_clauses = true csharp_indent_block_contents = true csharp_indent_braces = false csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = true csharp_indent_switch_labels = true csharp_indent_labels = one_less_than_current +# Modifier preferences +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion + # avoid this. unless absolutely necessary dotnet_style_qualification_for_field = false:suggestion dotnet_style_qualification_for_property = false:suggestion @@ -39,11 +76,11 @@ dotnet_style_qualification_for_method = false:suggestion dotnet_style_qualification_for_event = false:suggestion # only use var when it's obvious what the variable type is -csharp_style_var_for_built_in_types = false:none -csharp_style_var_when_type_is_apparent = false:suggestion -csharp_style_var_elsewhere = false:suggestion +csharp_style_var_for_built_in_types = true:suggestion +csharp_style_var_when_type_is_apparent = true:suggestion +csharp_style_var_elsewhere = true:suggestion -# use language keywords instead of BCL types +# prefer C# premade types. dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion dotnet_style_predefined_type_for_member_access = true:suggestion @@ -51,33 +88,42 @@ dotnet_style_predefined_type_for_member_access = true:suggestion dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style - dotnet_naming_symbols.constant_fields.applicable_kinds = field dotnet_naming_symbols.constant_fields.required_modifiers = const - dotnet_naming_style.pascal_case_style.capitalization = pascal_case # static fields should have s_ prefix +dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion +dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields +dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style dotnet_naming_symbols.static_fields.applicable_kinds = field dotnet_naming_symbols.static_fields.required_modifiers = static - -dotnet_naming_style.static_prefix_style.capitalization = camel_case +dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected +dotnet_naming_style.static_prefix_style.required_prefix = s_ +dotnet_naming_style.static_prefix_style.capitalization = camel_case # internal and private fields should be _camelCase dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style - dotnet_naming_symbols.private_internal_fields.applicable_kinds = field dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal - dotnet_naming_style.camel_case_underscore_style.required_prefix = _ -dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case +dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case # Code style defaults +csharp_using_directive_placement = outside_namespace:suggestion dotnet_sort_system_directives_first = true -csharp_preserve_single_line_blocks = true -csharp_preserve_single_line_statements = false +csharp_prefer_braces = true:silent +csharp_preserve_single_line_blocks = true:none +csharp_preserve_single_line_statements = false:none +csharp_prefer_static_local_function = true:suggestion +csharp_prefer_simple_using_statement = false:none +csharp_style_prefer_switch_expression = true:suggestion + +# Code quality +dotnet_style_readonly_field = true:suggestion +dotnet_code_quality_unused_parameters = non_public:suggestion # Expression-level preferences dotnet_style_object_initializer = true:suggestion @@ -85,14 +131,23 @@ dotnet_style_collection_initializer = true:suggestion dotnet_style_explicit_tuple_names = true:suggestion dotnet_style_coalesce_expression = true:suggestion dotnet_style_null_propagation = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_auto_properties = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +csharp_prefer_simple_default_expression = true:suggestion # Expression-bodied members -csharp_style_expression_bodied_methods = false:none -csharp_style_expression_bodied_constructors = false:none -csharp_style_expression_bodied_operators = false:none +csharp_style_expression_bodied_methods = true:suggestion +csharp_style_expression_bodied_constructors = true:suggestion +csharp_style_expression_bodied_operators = true:suggestion csharp_style_expression_bodied_properties = true:suggestion -csharp_style_expression_bodied_indexers = true:none -csharp_style_expression_bodied_accessors = true:none +csharp_style_expression_bodied_indexers = true:suggestion +csharp_style_expression_bodied_accessors = true:suggestion +csharp_style_expression_bodied_lambdas = true:suggestion +csharp_style_expression_bodied_local_functions = true:suggestion # Pattern matching csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion @@ -103,6 +158,11 @@ csharp_style_inlined_variable_declaration = true:suggestion csharp_style_throw_expression = true:suggestion csharp_style_conditional_delegate_call = true:suggestion +# Other features +csharp_style_prefer_index_operator = false:none +csharp_style_prefer_range_operator = false:none +csharp_style_pattern_local_over_anonymous_function = false:none + # Space preferences csharp_space_after_cast = false csharp_space_after_colon_in_inheritance_clause = true @@ -127,6 +187,319 @@ csharp_space_between_method_declaration_parameter_list_parentheses = false csharp_space_between_parentheses = false csharp_space_between_square_brackets = false +# analyzers +dotnet_diagnostic.AvoidAsyncVoid.severity = suggestion + +dotnet_diagnostic.CA1000.severity = none +dotnet_diagnostic.CA1001.severity = error +dotnet_diagnostic.CA1009.severity = error +dotnet_diagnostic.CA1016.severity = error +dotnet_diagnostic.CA1030.severity = none +dotnet_diagnostic.CA1031.severity = none +dotnet_diagnostic.CA1033.severity = none +dotnet_diagnostic.CA1036.severity = none +dotnet_diagnostic.CA1049.severity = error +dotnet_diagnostic.CA1056.severity = suggestion +dotnet_diagnostic.CA1060.severity = error +dotnet_diagnostic.CA1061.severity = error +dotnet_diagnostic.CA1063.severity = error +dotnet_diagnostic.CA1065.severity = error +dotnet_diagnostic.CA1301.severity = error +dotnet_diagnostic.CA1303.severity = none +dotnet_diagnostic.CA1308.severity = none +dotnet_diagnostic.CA1400.severity = error +dotnet_diagnostic.CA1401.severity = error +dotnet_diagnostic.CA1403.severity = error +dotnet_diagnostic.CA1404.severity = error +dotnet_diagnostic.CA1405.severity = error +dotnet_diagnostic.CA1410.severity = error +dotnet_diagnostic.CA1415.severity = error +dotnet_diagnostic.CA1507.severity = error +dotnet_diagnostic.CA1710.severity = suggestion +dotnet_diagnostic.CA1724.severity = none +dotnet_diagnostic.CA1810.severity = none +dotnet_diagnostic.CA1821.severity = error +dotnet_diagnostic.CA1900.severity = error +dotnet_diagnostic.CA1901.severity = error +dotnet_diagnostic.CA2000.severity = none +dotnet_diagnostic.CA2002.severity = error +dotnet_diagnostic.CA2007.severity = none +dotnet_diagnostic.CA2100.severity = error +dotnet_diagnostic.CA2101.severity = error +dotnet_diagnostic.CA2108.severity = error +dotnet_diagnostic.CA2111.severity = error +dotnet_diagnostic.CA2112.severity = error +dotnet_diagnostic.CA2114.severity = error +dotnet_diagnostic.CA2116.severity = error +dotnet_diagnostic.CA2117.severity = error +dotnet_diagnostic.CA2122.severity = error +dotnet_diagnostic.CA2123.severity = error +dotnet_diagnostic.CA2124.severity = error +dotnet_diagnostic.CA2126.severity = error +dotnet_diagnostic.CA2131.severity = error +dotnet_diagnostic.CA2132.severity = error +dotnet_diagnostic.CA2133.severity = error +dotnet_diagnostic.CA2134.severity = error +dotnet_diagnostic.CA2137.severity = error +dotnet_diagnostic.CA2138.severity = error +dotnet_diagnostic.CA2140.severity = error +dotnet_diagnostic.CA2141.severity = error +dotnet_diagnostic.CA2146.severity = error +dotnet_diagnostic.CA2147.severity = error +dotnet_diagnostic.CA2149.severity = error +dotnet_diagnostic.CA2200.severity = error +dotnet_diagnostic.CA2202.severity = error +dotnet_diagnostic.CA2207.severity = error +dotnet_diagnostic.CA2212.severity = error +dotnet_diagnostic.CA2213.severity = error +dotnet_diagnostic.CA2214.severity = error +dotnet_diagnostic.CA2216.severity = error +dotnet_diagnostic.CA2220.severity = error +dotnet_diagnostic.CA2229.severity = error +dotnet_diagnostic.CA2231.severity = error +dotnet_diagnostic.CA2232.severity = error +dotnet_diagnostic.CA2235.severity = error +dotnet_diagnostic.CA2236.severity = error +dotnet_diagnostic.CA2237.severity = error +dotnet_diagnostic.CA2238.severity = error +dotnet_diagnostic.CA2240.severity = error +dotnet_diagnostic.CA2241.severity = error +dotnet_diagnostic.CA2242.severity = error + +dotnet_diagnostic.RCS1001.severity = error +dotnet_diagnostic.RCS1018.severity = error +dotnet_diagnostic.RCS1037.severity = error +dotnet_diagnostic.RCS1055.severity = error +dotnet_diagnostic.RCS1062.severity = error +dotnet_diagnostic.RCS1066.severity = error +dotnet_diagnostic.RCS1069.severity = error +dotnet_diagnostic.RCS1071.severity = error +dotnet_diagnostic.RCS1074.severity = error +dotnet_diagnostic.RCS1090.severity = error +dotnet_diagnostic.RCS1138.severity = error +dotnet_diagnostic.RCS1139.severity = error +dotnet_diagnostic.RCS1163.severity = suggestion +dotnet_diagnostic.RCS1168.severity = suggestion +dotnet_diagnostic.RCS1188.severity = error +dotnet_diagnostic.RCS1201.severity = error +dotnet_diagnostic.RCS1207.severity = error +dotnet_diagnostic.RCS1211.severity = error +dotnet_diagnostic.RCS1507.severity = error + +dotnet_diagnostic.SA1000.severity = error +dotnet_diagnostic.SA1001.severity = error +dotnet_diagnostic.SA1002.severity = error +dotnet_diagnostic.SA1003.severity = error +dotnet_diagnostic.SA1004.severity = error +dotnet_diagnostic.SA1005.severity = error +dotnet_diagnostic.SA1006.severity = error +dotnet_diagnostic.SA1007.severity = error +dotnet_diagnostic.SA1008.severity = error +dotnet_diagnostic.SA1009.severity = error +dotnet_diagnostic.SA1010.severity = error +dotnet_diagnostic.SA1011.severity = error +dotnet_diagnostic.SA1012.severity = error +dotnet_diagnostic.SA1013.severity = error +dotnet_diagnostic.SA1014.severity = error +dotnet_diagnostic.SA1015.severity = error +dotnet_diagnostic.SA1016.severity = error +dotnet_diagnostic.SA1017.severity = error +dotnet_diagnostic.SA1018.severity = error +dotnet_diagnostic.SA1019.severity = error +dotnet_diagnostic.SA1020.severity = error +dotnet_diagnostic.SA1021.severity = error +dotnet_diagnostic.SA1022.severity = error +dotnet_diagnostic.SA1023.severity = error +dotnet_diagnostic.SA1024.severity = error +dotnet_diagnostic.SA1025.severity = error +dotnet_diagnostic.SA1026.severity = error +dotnet_diagnostic.SA1027.severity = error +dotnet_diagnostic.SA1028.severity = error +dotnet_diagnostic.SA1100.severity = error +dotnet_diagnostic.SA1101.severity = none +dotnet_diagnostic.SA1102.severity = error +dotnet_diagnostic.SA1103.severity = error +dotnet_diagnostic.SA1104.severity = error +dotnet_diagnostic.SA1105.severity = error +dotnet_diagnostic.SA1106.severity = error +dotnet_diagnostic.SA1107.severity = error +dotnet_diagnostic.SA1108.severity = error +dotnet_diagnostic.SA1110.severity = error +dotnet_diagnostic.SA1111.severity = error +dotnet_diagnostic.SA1112.severity = error +dotnet_diagnostic.SA1113.severity = error +dotnet_diagnostic.SA1114.severity = error +dotnet_diagnostic.SA1115.severity = error +dotnet_diagnostic.SA1116.severity = error +dotnet_diagnostic.SA1117.severity = error +dotnet_diagnostic.SA1118.severity = error +dotnet_diagnostic.SA1119.severity = error +dotnet_diagnostic.SA1120.severity = error +dotnet_diagnostic.SA1121.severity = error +dotnet_diagnostic.SA1122.severity = error +dotnet_diagnostic.SA1123.severity = error +dotnet_diagnostic.SA1124.severity = error +dotnet_diagnostic.SA1125.severity = error +dotnet_diagnostic.SA1127.severity = error +dotnet_diagnostic.SA1128.severity = error +dotnet_diagnostic.SA1129.severity = error +dotnet_diagnostic.SA1130.severity = error +dotnet_diagnostic.SA1131.severity = error +dotnet_diagnostic.SA1132.severity = error +dotnet_diagnostic.SA1133.severity = error +dotnet_diagnostic.SA1134.severity = error +dotnet_diagnostic.SA1135.severity = error +dotnet_diagnostic.SA1136.severity = error +dotnet_diagnostic.SA1137.severity = error +dotnet_diagnostic.SA1139.severity = error +dotnet_diagnostic.SA1200.severity = none +dotnet_diagnostic.SA1201.severity = error +dotnet_diagnostic.SA1202.severity = error +dotnet_diagnostic.SA1203.severity = error +dotnet_diagnostic.SA1204.severity = error +dotnet_diagnostic.SA1205.severity = error +dotnet_diagnostic.SA1206.severity = error +dotnet_diagnostic.SA1207.severity = error +dotnet_diagnostic.SA1208.severity = error +dotnet_diagnostic.SA1209.severity = error +dotnet_diagnostic.SA1210.severity = error +dotnet_diagnostic.SA1211.severity = error +dotnet_diagnostic.SA1212.severity = error +dotnet_diagnostic.SA1213.severity = error +dotnet_diagnostic.SA1214.severity = error +dotnet_diagnostic.SA1216.severity = error +dotnet_diagnostic.SA1217.severity = error +dotnet_diagnostic.SA1300.severity = error +dotnet_diagnostic.SA1302.severity = error +dotnet_diagnostic.SA1303.severity = error +dotnet_diagnostic.SA1304.severity = error +dotnet_diagnostic.SA1306.severity = none +dotnet_diagnostic.SA1307.severity = error +dotnet_diagnostic.SA1308.severity = error +dotnet_diagnostic.SA1309.severity = none +dotnet_diagnostic.SA1310.severity = error +dotnet_diagnostic.SA1311.severity = none +dotnet_diagnostic.SA1312.severity = error +dotnet_diagnostic.SA1313.severity = error +dotnet_diagnostic.SA1314.severity = error +dotnet_diagnostic.SA1316.severity = none +dotnet_diagnostic.SA1400.severity = error +dotnet_diagnostic.SA1401.severity = error +dotnet_diagnostic.SA1402.severity = error +dotnet_diagnostic.SA1403.severity = error +dotnet_diagnostic.SA1404.severity = error +dotnet_diagnostic.SA1405.severity = error +dotnet_diagnostic.SA1406.severity = error +dotnet_diagnostic.SA1407.severity = error +dotnet_diagnostic.SA1408.severity = error +dotnet_diagnostic.SA1410.severity = error +dotnet_diagnostic.SA1411.severity = error +dotnet_diagnostic.SA1413.severity = none +dotnet_diagnostic.SA1500.severity = error +dotnet_diagnostic.SA1501.severity = error +dotnet_diagnostic.SA1502.severity = error +dotnet_diagnostic.SA1503.severity = error +dotnet_diagnostic.SA1504.severity = error +dotnet_diagnostic.SA1505.severity = none +dotnet_diagnostic.SA1506.severity = error +dotnet_diagnostic.SA1507.severity = error +dotnet_diagnostic.SA1508.severity = error +dotnet_diagnostic.SA1509.severity = error +dotnet_diagnostic.SA1510.severity = error +dotnet_diagnostic.SA1511.severity = error +dotnet_diagnostic.SA1512.severity = error +dotnet_diagnostic.SA1513.severity = error +dotnet_diagnostic.SA1514.severity = none +dotnet_diagnostic.SA1515.severity = error +dotnet_diagnostic.SA1516.severity = error +dotnet_diagnostic.SA1517.severity = error +dotnet_diagnostic.SA1518.severity = error +dotnet_diagnostic.SA1519.severity = error +dotnet_diagnostic.SA1520.severity = error +dotnet_diagnostic.SA1600.severity = error +dotnet_diagnostic.SA1601.severity = error +dotnet_diagnostic.SA1602.severity = error +dotnet_diagnostic.SA1604.severity = error +dotnet_diagnostic.SA1605.severity = error +dotnet_diagnostic.SA1606.severity = error +dotnet_diagnostic.SA1607.severity = error +dotnet_diagnostic.SA1608.severity = error +dotnet_diagnostic.SA1610.severity = error +dotnet_diagnostic.SA1611.severity = error +dotnet_diagnostic.SA1612.severity = error +dotnet_diagnostic.SA1613.severity = error +dotnet_diagnostic.SA1614.severity = error +dotnet_diagnostic.SA1615.severity = error +dotnet_diagnostic.SA1616.severity = error +dotnet_diagnostic.SA1617.severity = error +dotnet_diagnostic.SA1618.severity = error +dotnet_diagnostic.SA1619.severity = error +dotnet_diagnostic.SA1620.severity = error +dotnet_diagnostic.SA1621.severity = error +dotnet_diagnostic.SA1622.severity = error +dotnet_diagnostic.SA1623.severity = error +dotnet_diagnostic.SA1624.severity = error +dotnet_diagnostic.SA1625.severity = error +dotnet_diagnostic.SA1626.severity = error +dotnet_diagnostic.SA1627.severity = error +dotnet_diagnostic.SA1629.severity = error +dotnet_diagnostic.SA1633.severity = error +dotnet_diagnostic.SA1634.severity = error +dotnet_diagnostic.SA1635.severity = error +dotnet_diagnostic.SA1636.severity = error +dotnet_diagnostic.SA1637.severity = none +dotnet_diagnostic.SA1638.severity = none +dotnet_diagnostic.SA1640.severity = error +dotnet_diagnostic.SA1641.severity = error +dotnet_diagnostic.SA1642.severity = error +dotnet_diagnostic.SA1643.severity = error +dotnet_diagnostic.SA1649.severity = error +dotnet_diagnostic.SA1651.severity = error + +dotnet_diagnostic.SX1101.severity = error +dotnet_diagnostic.SX1309.severity = error +dotnet_diagnostic.SX1623.severity = none +dotnet_diagnostic.RCS1102.severity=error +dotnet_diagnostic.RCS1166.severity=error +dotnet_diagnostic.RCS1078i.severity=error +dotnet_diagnostic.RCS1248.severity=error +dotnet_diagnostic.RCS1080.severity=error +dotnet_diagnostic.RCS1077.severity=error +dotnet_diagnostic.CA1825.severity=error +dotnet_diagnostic.CA1812.severity=error +dotnet_diagnostic.CA1805.severity=error +dotnet_diagnostic.RCS1197.severity=error +dotnet_diagnostic.RCS1198.severity=suggestion +dotnet_diagnostic.RCS1231.severity=suggestion +dotnet_diagnostic.RCS1235.severity=error +dotnet_diagnostic.RCS1242.severity=error +dotnet_diagnostic.CA2016.severity=warning +dotnet_diagnostic.CA2014.severity=error +dotnet_diagnostic.RCS1010.severity=error +dotnet_diagnostic.RCS1006.severity=error +dotnet_diagnostic.RCS1005.severity=error +dotnet_diagnostic.RCS1020.severity=error +dotnet_diagnostic.RCS1049.severity=warning +dotnet_diagnostic.RCS1058.severity=warning +dotnet_diagnostic.RCS1068.severity=warning +dotnet_diagnostic.RCS1073.severity=warning +dotnet_diagnostic.RCS1084.severity=error +dotnet_diagnostic.RCS1085.severity=error +dotnet_diagnostic.RCS1105.severity=error +dotnet_diagnostic.RCS1112.severity=error +dotnet_diagnostic.RCS1128.severity=error +dotnet_diagnostic.RCS1143.severity=error +dotnet_diagnostic.RCS1171.severity=error +dotnet_diagnostic.RCS1173.severity=error +dotnet_diagnostic.RCS1176.severity=error +dotnet_diagnostic.RCS1177.severity=error +dotnet_diagnostic.RCS1179.severity=error +dotnet_diagnostic.RCS1180.severity=warning +dotnet_diagnostic.RCS1190.severity=error +dotnet_diagnostic.RCS1194.severity=suggestion +dotnet_diagnostic.RCS1195.severity=error +dotnet_diagnostic.RCS1214.severity=error + # C++ Files [*.{cpp,h,in}] curly_bracket_next_line = true @@ -152,4 +525,4 @@ indent_size = 2 [*.sh] end_of_line = lf [*.{cmd, bat}] -end_of_line = crlf \ No newline at end of file +end_of_line = crlf diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 26c67ef..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,19 +0,0 @@ -trigger: -- master -- rel/* -- preview/* - -pr: -- master -- rel/* -- preview/* - -resources: - repositories: - - repository: templates - type: github - name: ReactiveUI/ReactiveUI.Cake.Recipe - endpoint: reactiveui - -jobs: -- template: Azure/azure-pipelines.yml@templates # Template reference diff --git a/build.cake b/build.cake deleted file mode 100644 index 4d8ea79..0000000 --- a/build.cake +++ /dev/null @@ -1,26 +0,0 @@ -#load nuget:https://pkgs.dev.azure.com/dotnet/ReactiveUI/_packaging/ReactiveUI/nuget/v3/index.json?package=ReactiveUI.Cake.Recipe&prerelease - -Environment.SetVariableNames(); - -// Whitelisted Packages -var packageWhitelist = new[] -{ - MakeAbsolute(File("./src/System.Reactive.Wasm/System.Reactive.Wasm.csproj")), -}; - -var packageTestWhitelist = new FilePath[] -{ - MakeAbsolute(File("./src/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj")), -}; - -BuildParameters.SetParameters(context: Context, - buildSystem: BuildSystem, - title: "Reactive.Wasm", - whitelistPackages: packageWhitelist, - whitelistTestPackages: packageTestWhitelist, - artifactsDirectory: "./artifacts", - sourceDirectory: "./src"); - -ToolSettings.SetToolSettings(context: Context); - -Build.Run(); diff --git a/build.cmd b/build.cmd deleted file mode 100644 index e5fa880..0000000 --- a/build.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -powershell -ExecutionPolicy Unrestricted ./build.ps1 %CAKE_ARGS% %* diff --git a/build.config b/build.config deleted file mode 100644 index ff37239..0000000 --- a/build.config +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -CAKE_VERSION=0.34.1 \ No newline at end of file diff --git a/build.ps1 b/build.ps1 deleted file mode 100644 index 5b0c98e..0000000 --- a/build.ps1 +++ /dev/null @@ -1,112 +0,0 @@ -$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent - -[string] $CakeVersion = '' -foreach($line in Get-Content "$PSScriptRoot\build.config") -{ - if ($line -like 'CAKE_VERSION=*') { - $CakeVersion = $line.SubString(13) - } -} - - -if ([string]::IsNullOrEmpty($CakeVersion)) { - 'Failed to parse Cake Version' - exit 1 -} - -# Make sure tools folder exists -$ToolPath = Join-Path $PSScriptRoot "tools" -if (!(Test-Path $ToolPath)) { - Write-Verbose "Creating tools directory..." - New-Item -Path $ToolPath -Type Directory -Force | out-null -} - - -if ($PSVersionTable.PSEdition -ne 'Core') { - # Attempt to set highest encryption available for SecurityProtocol. - # PowerShell will not set this by default (until maybe .NET 4.6.x). This - # will typically produce a message for PowerShell v2 (just an info - # message though) - try { - # Set TLS 1.2 (3072), then TLS 1.1 (768), then TLS 1.0 (192), finally SSL 3.0 (48) - # Use integers because the enumeration values for TLS 1.2 and TLS 1.1 won't - # exist in .NET 4.0, even though they are addressable if .NET 4.5+ is - # installed (.NET 4.5 is an in-place upgrade). - [System.Net.ServicePointManager]::SecurityProtocol = 3072 -bor 768 -bor 192 -bor 48 - } catch { - Write-Output 'Unable to set PowerShell to use TLS 1.2 and TLS 1.1 due to old .NET Framework installed. If you see underlying connection closed or trust errors, you may need to upgrade to .NET Framework 4.5+ and PowerShell v3' - } -} - -########################################################################### -# INSTALL .NET CORE CLI -########################################################################### - -Function Remove-PathVariable([string]$VariableToRemove) -{ - $SplitChar = ';' - if ($IsMacOS -or $IsLinux) { - $SplitChar = ':' - } - - $path = [Environment]::GetEnvironmentVariable("PATH", "User") - if ($path -ne $null) - { - $newItems = $path.Split($SplitChar, [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove } - [Environment]::SetEnvironmentVariable("PATH", [System.String]::Join($SplitChar, $newItems), "User") - } - - $path = [Environment]::GetEnvironmentVariable("PATH", "Process") - if ($path -ne $null) - { - $newItems = $path.Split($SplitChar, [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove } - [Environment]::SetEnvironmentVariable("PATH", [System.String]::Join($SplitChar, $newItems), "Process") - } -} - -$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 -$env:DOTNET_CLI_TELEMETRY_OPTOUT=1 - -########################################################################### -# INSTALL CAKE -########################################################################### - -# Make sure Cake has been installed. -[string] $CakeExePath = '' -[string] $CakeInstalledVersion = Get-Command dotnet-cake -ErrorAction SilentlyContinue | % {&$_.Source --version} - -if ($CakeInstalledVersion -eq $CakeVersion) { - # Cake found locally - $CakeExePath = (Get-Command dotnet-cake).Source -} -else { - $CakePath = Join-Path $ToolPath ".store\cake.tool\$CakeVersion" - $CakeExePath = (Get-ChildItem -Path $ToolPath -Filter "dotnet-cake*" -File| ForEach-Object FullName | Select-Object -First 1) - - - if ((!(Test-Path -Path $CakePath -PathType Container)) -or (!(Test-Path $CakeExePath -PathType Leaf))) { - - if ((![string]::IsNullOrEmpty($CakeExePath)) -and (Test-Path $CakeExePath -PathType Leaf)) - { - & dotnet tool uninstall --tool-path $ToolPath Cake.Tool - } - - & dotnet tool install --tool-path $ToolPath --version $CakeVersion Cake.Tool - if ($LASTEXITCODE -ne 0) - { - 'Failed to install cake' - exit 1 - } - $CakeExePath = (Get-ChildItem -Path $ToolPath -Filter "dotnet-cake*" -File| ForEach-Object FullName | Select-Object -First 1) - } -} - -########################################################################### -# RUN BUILD SCRIPT -########################################################################### -& "$CakeExePath" ./build.cake --bootstrap -if ($LASTEXITCODE -eq 0) -{ - & "$CakeExePath" ./build.cake $args -} -exit $LASTEXITCODE \ No newline at end of file diff --git a/build.sh b/build.sh deleted file mode 100755 index 8c2183f..0000000 --- a/build.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash -# Define varibles -SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -source $SCRIPT_DIR/build.config -TOOLS_DIR=$SCRIPT_DIR/tools -CAKE_EXE=$TOOLS_DIR/dotnet-cake -CAKE_PATH=$TOOLS_DIR/.store/cake.tool/$CAKE_VERSION - -# Make sure the tools folder exist. -if [ ! -d "$TOOLS_DIR" ]; then - mkdir "$TOOLS_DIR" -fi - -########################################################################### -# INSTALL CAKE -########################################################################### -export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 -export DOTNET_CLI_TELEMETRY_OPTOUT=1 -export DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0 - -CAKE_INSTALLED_VERSION=$(dotnet-cake --version 2>&1) - -if [ "$CAKE_VERSION" != "$CAKE_INSTALLED_VERSION" ]; then - if [ ! -f "$CAKE_EXE" ] || [ ! -d "$CAKE_PATH" ]; then - if [ -f "$CAKE_EXE" ]; then - dotnet tool uninstall --tool-path $TOOLS_DIR Cake.Tool - fi - - echo "Installing Cake $CAKE_VERSION..." - dotnet tool install --tool-path $TOOLS_DIR --version $CAKE_VERSION Cake.Tool - if [ $? -ne 0 ]; then - echo "An error occured while installing Cake." - exit 1 - fi - fi - - # Make sure that Cake has been installed. - if [ ! -f "$CAKE_EXE" ]; then - echo "Could not find Cake.exe at '$CAKE_EXE'." - exit 1 - fi -else - CAKE_EXE="dotnet-cake" -fi - -########################################################################### -# RUN BUILD SCRIPT -########################################################################### - -# Start Cake -(exec "$CAKE_EXE" --bootstrap) && (exec "$CAKE_EXE" "$@") \ No newline at end of file diff --git a/cake.config b/cake.config deleted file mode 100644 index c26865e..0000000 --- a/cake.config +++ /dev/null @@ -1,7 +0,0 @@ -[Paths] -Tools=./tools -Addins=./tools/Addins -Modules=./tools/Modules - -[NuGet] -UseInProcessClient=true diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props new file mode 100644 index 0000000..c24102f --- /dev/null +++ b/src/Directory.Packages.props @@ -0,0 +1,27 @@ + + + true + true + + + 6.0.0 + 14.8.12 + 2.7.0 + + + + + + + + + + + + + + + + + + diff --git a/src/Directory.build.props b/src/Directory.build.props index 5e3d0b0..848920f 100644 --- a/src/Directory.build.props +++ b/src/Directory.build.props @@ -1,21 +1,15 @@ - + - .NET Foundation and Contributors Copyright (c) .NET Foundation and Contributors - $(NoWarn);VSX1000 - AnyCPU - $(MSBuildProjectName.Contains('Tests')) - git - true - $(MSBuildThisFileDirectory)analyzers.ruleset - Wasm implementation for System.Reactive. mvvm;rx;reactive extensions;observable;frp;uwp;net;netstandard;uno;blazer MIT https://github.com/reactiveui/Reactive.Wasm/releases https://github.com/reactiveui/Reactive.Wasm https://github.com/reactiveui/Reactive.Wasm https://raw.githubusercontent.com/dotnet/reactive/0f837d11385cfaf575861ccc5a5fbcafb22d888f/Rx.NET/Resources/Artwork/Logo.png + .NET Foundation and Contributors git + true $(MSBuildProjectName.Contains('Tests')) Embedded @@ -25,43 +19,40 @@ $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb - false - $(EnableSourceLink) + nullable + True + latest + enable + enable + preview + - $(MSBuildThisFileDirectory)analyzers.tests.ruleset - false + $(MSBuildThisFileDirectory)analyzers.tests.ruleset + false - - - - - - - - - - - - + + + + + + + + - - + - - - + + - - - - + + diff --git a/src/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj b/src/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj index f4b8ad2..3a111d4 100644 --- a/src/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj +++ b/src/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp2.2 + net8 false diff --git a/src/System.Reactive.Wasm/Concurrency/ConcurrencyAbstractionLayerWasmImpl.cs b/src/System.Reactive.Wasm/Concurrency/ConcurrencyAbstractionLayerWasmImpl.cs index a38a2a5..d0347b7 100644 --- a/src/System.Reactive.Wasm/Concurrency/ConcurrencyAbstractionLayerWasmImpl.cs +++ b/src/System.Reactive.Wasm/Concurrency/ConcurrencyAbstractionLayerWasmImpl.cs @@ -1,10 +1,9 @@ -// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Copyright (c) 2019-2024 .NET Foundation and Contributors. All rights reserved. // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. using System.Reactive.Disposables; -using System.Threading; namespace System.Reactive.Concurrency { @@ -17,7 +16,7 @@ internal class ConcurrencyAbstractionLayerWasmImpl : IConcurrencyAbstractionLaye public bool SupportsLongRunning => false; /// - public IDisposable StartTimer(Action action, object state, TimeSpan dueTime) => new Timer(action, state, Normalize(dueTime)); + public IDisposable StartTimer(Action action, object? state, TimeSpan dueTime) => new Timer(action, state, Normalize(dueTime)); /// public IDisposable StartPeriodicTimer(Action action, TimeSpan period) @@ -38,7 +37,7 @@ public IDisposable StartPeriodicTimer(Action action, TimeSpan period) } /// - public IDisposable QueueUserWorkItem(Action action, object state) + public IDisposable QueueUserWorkItem(Action action, object? state) { ThreadPool.QueueUserWorkItem(_ => action(_), state); return Disposable.Empty; @@ -51,7 +50,7 @@ public IDisposable QueueUserWorkItem(Action action, object state) public IStopwatch StartStopwatch() => new StopwatchImpl(); /// - public void StartThread(Action action, object state) + public void StartThread(Action action, object? state) { new Thread(() => { @@ -132,10 +131,10 @@ public void StartThread(Action action, object state) // symbol. private sealed class Timer : IDisposable { - private Action _action; + private Action _action; private volatile System.Threading.Timer _timer; - public Timer(Action action, object state, TimeSpan dueTime) + public Timer(Action action, object? state, TimeSpan dueTime) { _action = action; @@ -153,13 +152,13 @@ public Timer(Action action, object state, TimeSpan dueTime) public void Dispose() { - System.Threading.Timer timer = _timer; + var timer = _timer; if (timer == TimerStubs.Never) { return; } - _action = Stubs.Ignore; + _action = Stubs.Ignore; _timer = TimerStubs.Never; timer.Dispose(); @@ -184,7 +183,7 @@ private void Tick(object state) private sealed class PeriodicTimer : IDisposable { private Action _action; - private volatile System.Threading.Timer _timer; + private volatile System.Threading.Timer? _timer; public PeriodicTimer(Action action, TimeSpan period) { @@ -197,7 +196,7 @@ public PeriodicTimer(Action action, TimeSpan period) public void Dispose() { - System.Threading.Timer timer = _timer; + var timer = _timer; if (timer == null) { return; diff --git a/src/System.Reactive.Wasm/Internal/PlatformEnlightenmentProviderExtensions.cs b/src/System.Reactive.Wasm/Internal/PlatformEnlightenmentProviderExtensions.cs index fbe0b52..0ed5beb 100644 --- a/src/System.Reactive.Wasm/Internal/PlatformEnlightenmentProviderExtensions.cs +++ b/src/System.Reactive.Wasm/Internal/PlatformEnlightenmentProviderExtensions.cs @@ -1,12 +1,8 @@ -// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Copyright (c) 2019-2024 .NET Foundation and Contributors. All rights reserved. // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Collections.Generic; -using System.Text; - namespace System.Reactive.PlatformServices { /// diff --git a/src/System.Reactive.Wasm/Internal/StopwatchImpl.cs b/src/System.Reactive.Wasm/Internal/StopwatchImpl.cs index 1064f0a..bfb80e9 100644 --- a/src/System.Reactive.Wasm/Internal/StopwatchImpl.cs +++ b/src/System.Reactive.Wasm/Internal/StopwatchImpl.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Copyright (c) 2019-2024 .NET Foundation and Contributors. All rights reserved. // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. diff --git a/src/System.Reactive.Wasm/Internal/Stubs.cs b/src/System.Reactive.Wasm/Internal/Stubs.cs index 3fa4da8..97fe781 100644 --- a/src/System.Reactive.Wasm/Internal/Stubs.cs +++ b/src/System.Reactive.Wasm/Internal/Stubs.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Copyright (c) 2019-2024 .NET Foundation and Contributors. All rights reserved. // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. diff --git a/src/System.Reactive.Wasm/Internal/TimerStubs.cs b/src/System.Reactive.Wasm/Internal/TimerStubs.cs index fbcb68b..0c2ce0e 100644 --- a/src/System.Reactive.Wasm/Internal/TimerStubs.cs +++ b/src/System.Reactive.Wasm/Internal/TimerStubs.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Copyright (c) 2019-2024 .NET Foundation and Contributors. All rights reserved. // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. diff --git a/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs b/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs index 1a235f9..80ebfe0 100644 --- a/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs +++ b/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Copyright (c) 2019-2024 .NET Foundation and Contributors. All rights reserved. // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,7 +6,7 @@ // WARNING: The full namespace-qualified type name should stay the same for the discovery in System.Reactive.Core to work! using System.ComponentModel; using System.Reactive.Concurrency; -using System.Threading; + using Splat; namespace System.Reactive.PlatformServices @@ -33,14 +33,15 @@ public class WasmPlatformEnlightenmentProvider : CurrentPlatformEnlightenmentPro /// Service type. /// Optional set of arguments. /// Service instance or null if not found. - public override T GetService(object[] args) + public override T? GetService(object[] args) + where T : class { if (!IsWasm) { return base.GetService(args); } - Type t = typeof(T); + var t = typeof(T); if (t == typeof(IConcurrencyAbstractionLayer)) { diff --git a/src/System.Reactive.Wasm/Internal/WasmScheduler.cs b/src/System.Reactive.Wasm/Internal/WasmScheduler.cs index 74ca11f..125bad5 100644 --- a/src/System.Reactive.Wasm/Internal/WasmScheduler.cs +++ b/src/System.Reactive.Wasm/Internal/WasmScheduler.cs @@ -1,12 +1,10 @@ -// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Copyright (c) 2019-2024 .NET Foundation and Contributors. All rights reserved. // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.Generic; using System.Reactive.Disposables; using System.Reflection; -using System.Runtime.CompilerServices; namespace System.Reactive.Concurrency { @@ -30,7 +28,7 @@ public override IDisposable Schedule(TState state, Func { @@ -69,8 +67,8 @@ public IDisposable SchedulePeriodic(TState state, TimeSpan period, Func< throw new ArgumentNullException(nameof(action)); } - TState state1 = state; - AsyncLock gate = new AsyncLock(); + var state1 = state; + var gate = new AsyncLock(); WasmRuntime.ScheduleTimeout( (int)period.TotalMilliseconds, @@ -102,14 +100,14 @@ public override IDisposable Schedule(TState state, TimeSpan dueTime, Fun throw new ArgumentNullException(nameof(action)); } - TimeSpan dt = Scheduler.Normalize(dueTime); + var dt = Scheduler.Normalize(dueTime); if (dt.Ticks == 0) { return Schedule(state, action); } - SingleAssignmentDisposable d = new SingleAssignmentDisposable(); + var d = new SingleAssignmentDisposable(); WasmRuntime.ScheduleTimeout( (int)dt.TotalMilliseconds, diff --git a/src/System.Reactive.Wasm/System.Reactive.Wasm.csproj b/src/System.Reactive.Wasm/System.Reactive.Wasm.csproj index dcba29c..09d8f6a 100644 --- a/src/System.Reactive.Wasm/System.Reactive.Wasm.csproj +++ b/src/System.Reactive.Wasm/System.Reactive.Wasm.csproj @@ -1,14 +1,11 @@ - netstandard2.0 Reactive.Wasm Wasm implementation for System.Reactive - - - + + - - + \ No newline at end of file diff --git a/src/stylecop.json b/src/stylecop.json index 66c88ad..d9e51bd 100644 --- a/src/stylecop.json +++ b/src/stylecop.json @@ -13,7 +13,7 @@ "documentPrivateFields": false, "documentationCulture": "en-US", "companyName": ".NET Foundation and Contributors", - "copyrightText": "Copyright (c) 2019 {companyName}. All rights reserved.\nLicensed to the .NET Foundation under one or more agreements.\nThe .NET Foundation licenses this file to you under the {licenseName} license.\nSee the {licenseFile} file in the project root for full license information.", + "copyrightText": "Copyright (c) 2019-2024 {companyName}. All rights reserved.\nLicensed to the .NET Foundation under one or more agreements.\nThe .NET Foundation licenses this file to you under the {licenseName} license.\nSee the {licenseFile} file in the project root for full license information.", "variables": { "licenseName": "MIT", "licenseFile": "LICENSE" @@ -36,6 +36,6 @@ "orderingRules": { "usingDirectivesPlacement": "outsideNamespace", "systemUsingDirectivesFirst": true - }, + } } }