Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/1898 fix diagnostics #1928

Merged
merged 53 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
c764ce5
Exploit unconstrained type parameter annotations
idg10 May 3, 2023
cf30c81
Re-enable CA1003 (no statics on generic types)
idg10 May 3, 2023
176f34b
Re-enable CA1003 (event delegate type)
idg10 May 3, 2023
45a814a
Re-enable CA1014 and CA1019
idg10 May 3, 2023
e38ea92
Re-enable CA1033
idg10 May 3, 2023
88dbb4e
Re-enable CA1045, CA1051
idg10 May 3, 2023
69e9097
Re-enable CA1052
idg10 May 3, 2023
e557cc8
Re-enable CA1063
idg10 May 3, 2023
075316c
Re-enable CA1067
idg10 May 3, 2023
803d9ca
Re-enable CA1068.
idg10 May 3, 2023
747279b
Re-enable CA1507 (nameof)
idg10 May 3, 2023
853908b
Re-enable CA1707
idg10 May 3, 2023
499a57c
Re-enable CA1711 (don't use Ex suffix.)
idg10 May 3, 2023
60e9834
Re-enable CA1716
idg10 May 3, 2023
43f7072
Re-enable CA1720 (Identifier contains type name.)
idg10 May 3, 2023
e9b2654
Re-enable CA1806 (unused instances)
idg10 May 3, 2023
9e04b52
Re-enable CA1815 (structs implement Equals)
idg10 May 3, 2023
9330b97
Re-enable CA1816
idg10 May 3, 2023
e8e0606
Re-enable CA1822 in non-test projects
idg10 May 4, 2023
6ccd0b6
Re-enable CA1825 (Array.Empty<T>())
idg10 May 4, 2023
28b05e3
Re-enable CA1840 (Environment.CurrentManagedThreadId)
idg10 May 4, 2023
00408a2
Re-enable CA1845 (span-based string concatenation)
idg10 May 4, 2023
4c70a81
Re-enable CA2016 (forward CancellationToken)
idg10 May 4, 2023
2f63e8d
Re-enable CA2109 (review event handling visibility)
idg10 May 4, 2023
e72541b
Re-enable CA2109 (don't throw reserved exceptions)
idg10 May 4, 2023
1901547
Re-enable CA2211 (no public writeable fields)
idg10 May 4, 2023
6aa3340
Re-enable CA2249
idg10 May 4, 2023
16b4034
Re-enable IDE0003 (consistent this. use)
idg10 May 4, 2023
5ffb2be
Re-enable IDE0016 (throw expressions)
idg10 May 4, 2023
e8ac782
Re-enable IDE0017 (object initializers)
idg10 May 4, 2023
2fa607b
Re-enable expression-level IDExxx analyzers
idg10 May 4, 2023
596ba3c
Re-enable pattern analyzers
idg10 May 4, 2023
d3b34c2
Re-enable IDE0031 (null propagation)
idg10 May 4, 2023
1378a05
Re-enable IDE0032 (auto properties)
idg10 May 4, 2023
aa2fe01
Re-enable IDE0037 (inferred member names)
idg10 May 4, 2023
b92bb7e
Re-enable modifier analyzers
idg10 May 4, 2023
3cbec48
Re-enable private member analyzers
idg10 May 4, 2023
4776b87
Re-enable IDE0060 (remove unused parameters)
idg10 May 5, 2023
e4c0ccd
Re-enable IDE0059 (unnecessary assignment)
idg10 May 5, 2023
8f5749d
Re-enable IDE0062 (make local functions static)
idg10 May 5, 2023
ad8a973
Re-enable IDE0063 (simplify using statements)
idg10 May 5, 2023
873edad
Re-enable IDE0071 (simplify interpolation)
idg10 May 5, 2023
4d0d04c
Re-enable IDE0074 (compound assignment)
idg10 May 5, 2023
ca4f3c4
Re-enable IDE0075 (simplify conditionals)
idg10 May 5, 2023
fd731bd
Re-enable IDE0076 (invalid suppression target)
idg10 May 9, 2023
8b38288
Re-enable IDE0077 (legacy target format in suppressions)
idg10 May 9, 2023
05b956b
Fix unnecessary suppressions
idg10 May 10, 2023
ed3e1eb
Re-enable IDE0270 (simplify null checks)
idg10 May 11, 2023
7a68291
Re-enable IDE0280 (use nameof)
idg10 May 11, 2023
f7735aa
Remove IDE1056 suppression
idg10 May 11, 2023
a25aa21
Upgrade analysis levels to 7.0
idg10 May 11, 2023
a89b22b
Change 5.0 to 7.0 in Benchmarks project
idg10 May 11, 2023
c27ef2e
Revert spurious addition to warning restore comment
idg10 May 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dotnet_style_predefined_type_for_member_access = true:suggestion
dotnet_style_readonly_field = true:warning

# Suggest more modern language features when available
dotnet_style_object_initializer = true:suggestion
dotnet_style_object_initializer = true:silent
dotnet_style_collection_initializer = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
Expand All @@ -74,7 +74,7 @@ dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_conditional_expression_over_return = false
dotnet_style_prefer_conditional_expression_over_assignment = false
dotnet_style_prefer_auto_properties = true:suggestion
dotnet_style_prefer_auto_properties = true:silent

# Parentheses
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
Expand Down
36 changes: 31 additions & 5 deletions Rx.NET/Source/Directory.build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,11 @@
<DefaultLanguage>en-US</DefaultLanguage>
<IncludeSymbols>false</IncludeSymbols>
<IsTestProject>$(MSBuildProjectName.Contains('Tests'))</IsTestProject>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)Rx.ruleset</CodeAnalysisRuleSet>
<GeneratePackageOnBuild Condition=" '$(IsTestProject)' != 'true' and '$(CreatePackage)' == 'true' ">true</GeneratePackageOnBuild>
<PackageOutputPath>$(MSBuildThisFileDirectory)artifacts</PackageOutputPath>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<LangVersion>latest</LangVersion>

<!-- Get diagnostics back to the level that the .NET 5.0 SDK had for now. Fix these properly before release. -->
<AnalysisLevel>5-Default</AnalysisLevel>
<NoWarn>$(NoWarn);CS8600;CS8602;CS8603;CS8604;CS8632;CA1000;CA1003;CA1014;CA1019;CA1033;CA1045;CA1051;CA1052;CA1063;CA1067;CA1068;CA1507;CA1707;CA1711;CA1716;CA1720;CA1806;CA1815;CA1816;CA1822;CA1825;CA1840;CA1845;CA2016;CA2109;CA2201;CA2211;CA2213;CA2249;IDE0003;IDE0016;IDE0017;IDE0018;IDE0019;IDE0020;IDE0031;IDE0032;IDE0034;IDE0037;IDE0038;IDE0039;IDE0040;IDE0044;IDE0051;IDE0052;IDE0056;IDE0057;IDE0059;IDE0060;IDE0062;IDE0063;IDE0071;IDE0074;IDE0075;IDE0076;IDE0077;IDE0079;IDE0083;IDE0090;IDE0180;IDE0270;IDE0280;IDE1006;IDE1056</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' != 'Debug'">
Expand All @@ -43,4 +38,35 @@
<PackageReference Include="coverlet.collector" Version="3.2.0" />
</ItemGroup>

<PropertyGroup>
<AnalysisLevelDesign>7.0-default</AnalysisLevelDesign>
<AnalysisLevelNaming>7.0-all</AnalysisLevelNaming>
<AnalysisLevelPerformance>7.0-all</AnalysisLevelPerformance>

<!-- Enable analyzers on older targets. -->
<EnableNETAnalyzers>true</EnableNETAnalyzers>

<!--
Disable diagnostics:
CA1001 - types holding disposable fields should implement IDisposable. See next item.
CA2213 - IDisposable types should Dispose any IDisposable fields. This rule finds over 600
examples! These are all in subtle multithreaded or async code. Some of them appear
not to be real problems. For example, there are places where schedulers retain
references to IDisposable work items, but that IDisposable interfaces is only there
to enable application code to cancel scheduled work, so it's not Rx's place to call
Dispose. And there are more subtle cases where disposal is deferred to give threads
a chance to shut down. Each of these likely needs individual review:
https://github.com/dotnet/reactive/issues/1927

IDE0056 - Use of index/range syntax - relevant types not available on all targets, so we can't
IDE0057 do this.
-->
<!-- Get diagnostics back to the level that the .NET 5.0 SDK had for now. Fix these properly before release. -->
<NoWarn>$(NoWarn);CA1001;CA2213;IDE0056;IDE0057</NoWarn>
</PropertyGroup>

<ItemGroup>
<GlobalAnalyzerConfigFiles Include="$(MSBuildThisFileDirectory)analyzers.globalconfig" />
</ItemGroup>

</Project>
222 changes: 0 additions & 222 deletions Rx.NET/Source/Rx.ruleset

This file was deleted.

12 changes: 10 additions & 2 deletions Rx.NET/Source/System.Reactive.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28407.52
# Visual Studio Version 17
VisualStudioVersion = 17.5.33627.172
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Reactive", "src\System.Reactive\System.Reactive.csproj", "{01706A0F-8A63-4FD6-AF45-0BC0BED3C0D9}"
EndProject
Expand All @@ -15,6 +15,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.System.Reactive.Uwp.D
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{870348D0-C0A0-4352-8A02-E00AB0CCB919}"
ProjectSection(SolutionItems) = preProject
..\..\.editorconfig = ..\..\.editorconfig
src\.editorconfig = src\.editorconfig
analyzers.globalconfig = analyzers.globalconfig
..\..\azure-pipelines.rx.yml = ..\..\azure-pipelines.rx.yml
Directory.build.props = Directory.build.props
Directory.build.targets = Directory.build.targets
Expand All @@ -25,6 +28,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{D324579D-CBE6-4867-8980-D7842C7C45A2}"
ProjectSection(SolutionItems) = preProject
tests\.editorconfig = tests\.editorconfig
tests\Directory.build.props = tests\Directory.build.props
tests\Directory.build.targets = tests\Directory.build.targets
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Facades", "Facades", "{A0F39260-B8F8-4FCB-9679-0ED917A22BDF}"
ProjectSection(SolutionItems) = preProject
Expand Down