-
Notifications
You must be signed in to change notification settings - Fork 751
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
Commits on May 3, 2023
-
Exploit unconstrained type parameter annotations
This enables us to re-enable warnings CS8600, CS8602, CS8603, CS8604, and CS8632. When support for nullable reference types was added to Rx in 2020, you were not allowed to write `T?` if `T` was an unconstrained type parameter. Although that made sense - if `T` could be either a value type or a reference type, `T?` could mean fundamentally different things for different type arguments - in practice it was unhelpful because it meant there was no straightforward way to indicate "nullable in cases where T is a reference type", which is often what was required in practice. C# 9.0 added a feature that removed this limitation: https:/dotnet/csharplang/blob/main/proposals/csharp-9.0/unconstrained-type-parameter-annotations.md This commit takes advantage of this language feature to better express some of the existing null handling.
Configuration menu - View commit details
-
Copy full SHA for c764ce5 - Browse repository at this point
Copy the full SHA c764ce5View commit details -
Re-enable CA1003 (no statics on generic types)
The analyzer was producing a spurious diagnostic for TaskObservableMethodBuilder<T> - the rules for how method builders work require them to be generic, and to define a static Create method.
Configuration menu - View commit details
-
Copy full SHA for cf30c81 - Browse repository at this point
Copy the full SHA cf30c81View commit details -
Re-enable CA1003 (event delegate type)
This analyzer wanted IEventSource<T>.OnNext and IEventPatternSource<T>.OnNext to use EventHandler<T>, but by design these takes the unusual step of using other delegate types for an event.
Configuration menu - View commit details
-
Copy full SHA for 176f34b - Browse repository at this point
Copy the full SHA 176f34bView commit details -
No longer causing warnings, possibly because changes in earlier commits have now resolved these issues.
Configuration menu - View commit details
-
Copy full SHA for 45a814a - Browse repository at this point
Copy the full SHA 45a814aView commit details -
Add suppression to ScheduledItem because this analyzer wanted us to make its IDisposable implementation overridable, which would not really be appropriate for that specialized base type.
Configuration menu - View commit details
-
Copy full SHA for e38ea92 - Browse repository at this point
Copy the full SHA e38ea92View commit details -
Suppressed spurious warnings on the TaskObservableMethodBuilder, which has to use ref because it's an async method builder.
Configuration menu - View commit details
-
Copy full SHA for 88dbb4e - Browse repository at this point
Copy the full SHA 88dbb4eView commit details -
Added suppression to CA1052 because it is designed to be inherited from, despite having no instance members.
Configuration menu - View commit details
-
Copy full SHA for 69e9097 - Browse repository at this point
Copy the full SHA 69e9097View commit details -
Add suppressions for the classes where this analyzer wants us to make breaking changes to the public API.
Configuration menu - View commit details
-
Copy full SHA for e557cc8 - Browse repository at this point
Copy the full SHA e557cc8View commit details -
Suppress in the test code that this analyzer identifies, whihc doesn't need the recommended change.
Configuration menu - View commit details
-
Copy full SHA for 075316c - Browse repository at this point
Copy the full SHA 075316cView commit details -
Make suggested changes for internal methods. Add suppression for the two public methods for which this analyzer suggests a breaking change (and for the one internal method where the signature is determined by the ISchedulerLongRunning interface and can't be changed).
Configuration menu - View commit details
-
Copy full SHA for 803d9ca - Browse repository at this point
Copy the full SHA 803d9caView commit details -
Configuration menu - View commit details
-
Copy full SHA for 747279b - Browse repository at this point
Copy the full SHA 747279bView commit details -
This no longer seems to show up. Perhaps other changes have now addressed this.
Configuration menu - View commit details
-
Copy full SHA for 853908b - Browse repository at this point
Copy the full SHA 853908bView commit details -
Re-enable CA1711 (don't use Ex suffix.)
Add suppressions for the public types that have existed for many years.
Configuration menu - View commit details
-
Copy full SHA for 499a57c - Browse repository at this point
Copy the full SHA 499a57cView commit details -
Suppress the one place this showed up. It was complaining about the use of 'error' as an argument name. It has been that way for years, and changing this name would break any code using named arguments.
Configuration menu - View commit details
-
Copy full SHA for 60e9834 - Browse repository at this point
Copy the full SHA 60e9834View commit details -
Re-enable CA1720 (Identifier contains type name.)
This didn't like Single, but that's a long-established LINQ method name, so we just have to suppress the warning.
Configuration menu - View commit details
-
Copy full SHA for 43f7072 - Browse repository at this point
Copy the full SHA 43f7072View commit details -
Re-enable CA1806 (unused instances)
Added suppressions in the various tests for which this was a spurious message, because they all expect the relevant constructor to throw. Fixed one actual bug! (ForkJoin_Nary_Immediate called SequenceEqual but never inspected the result. It should have been AssertEqual.)
Configuration menu - View commit details
-
Copy full SHA for e9b2654 - Browse repository at this point
Copy the full SHA e9b2654View commit details -
Re-enable CA1815 (structs implement Equals)
Suppressed on task builder where it's not required.
Configuration menu - View commit details
-
Copy full SHA for 9e04b52 - Browse repository at this point
Copy the full SHA 9e04b52View commit details -
Add suppression for ScheduledItem for same reason as other IDisposable-related suppressions.
Configuration menu - View commit details
-
Copy full SHA for 9330b97 - Browse repository at this point
Copy the full SHA 9330b97View commit details
Commits on May 4, 2023
-
Re-enable CA1822 in non-test projects
Now disabled in test projects only, because it would take a lot of work to adjust the test projects to fit this rule, with little benefit.
Configuration menu - View commit details
-
Copy full SHA for e8e0606 - Browse repository at this point
Copy the full SHA e8e0606View commit details -
Re-enable CA1825 (Array.Empty<T>())
Remains disabled in test projects, because the impact on readability is not justified by the minimal performance benefits there.
Configuration menu - View commit details
-
Copy full SHA for 6ccd0b6 - Browse repository at this point
Copy the full SHA 6ccd0b6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 28b05e3 - Browse repository at this point
Copy the full SHA 28b05e3View commit details -
Re-enable CA1845 (span-based string concatenation)
Now disabled for tests only. This is a fairly low-level change that won't have a measurable impact on test performance, so we only want this enabled for the production libraries.
Configuration menu - View commit details
-
Copy full SHA for 00408a2 - Browse repository at this point
Copy the full SHA 00408a2View commit details -
Re-enable CA2016 (forward CancellationToken)
A few tests were deliberately not forwarding it in order to test scenarios where that happens. These now do so explicitly to avoid the warning (or, in the one case where we specifically want to test an Rx overload that doesn't take a CancellationToken argument, we just suppress the message).
Configuration menu - View commit details
-
Copy full SHA for 4c70a81 - Browse repository at this point
Copy the full SHA 4c70a81View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2f63e8d - Browse repository at this point
Copy the full SHA 2f63e8dView commit details -
Re-enable CA2109 (don't throw reserved exceptions)
Added a couple of suppressions because for backwards compatibility, we need to continue to throw NullReferenceException in a couple of places.
Configuration menu - View commit details
-
Copy full SHA for e72541b - Browse repository at this point
Copy the full SHA e72541bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1901547 - Browse repository at this point
Copy the full SHA 1901547View commit details -
Also add comment explaining why we're leaving CA2213 disabled.
Configuration menu - View commit details
-
Copy full SHA for 6aa3340 - Browse repository at this point
Copy the full SHA 6aa3340View commit details -
Configuration menu - View commit details
-
Copy full SHA for 16b4034 - Browse repository at this point
Copy the full SHA 16b4034View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ffb2be - Browse repository at this point
Copy the full SHA 5ffb2beView commit details -
Re-enable IDE0017 (object initializers)
Set to silent suggest in .editorconfig, because the analyzer tends to be too keen: it suggests it even for individual properties, with the result that its 'simpler' suggestion is more verbose than what it replaces.
Configuration menu - View commit details
-
Copy full SHA for e8ac782 - Browse repository at this point
Copy the full SHA e8ac782View commit details -
Re-enable expression-level IDExxx analyzers
Enabled IDE0018, IDE0034, IDE0039, IDE0056, IDE0057, IDE0090 and IDE0180 Also brought a few straggling non-var declarations into line with the (obviously wrong, but sadly established) policy of using var everywhere.
Configuration menu - View commit details
-
Copy full SHA for 2fa607b - Browse repository at this point
Copy the full SHA 2fa607bView commit details -
IDE0019, IDE0020, IDE0038 and IDE0083. Used modern patterns where suggested.
Configuration menu - View commit details
-
Copy full SHA for 596ba3c - Browse repository at this point
Copy the full SHA 596ba3cView commit details -
Configuration menu - View commit details
-
Copy full SHA for d3b34c2 - Browse repository at this point
Copy the full SHA d3b34c2View commit details -
Re-enable IDE0032 (auto properties)
But we're downgrading it from suggest to silent, because in all the cases I looked at where this suggested a change, the existing use of fields made it easier to see how the internal state of the various objects worked.
Configuration menu - View commit details
-
Copy full SHA for 1378a05 - Browse repository at this point
Copy the full SHA 1378a05View commit details -
Re-enable IDE0037 (inferred member names)
Also change a corresponding use of anonymous types to tuples.
Configuration menu - View commit details
-
Copy full SHA for aa2fe01 - Browse repository at this point
Copy the full SHA aa2fe01View commit details -
IDE0040 and IDE0044. Also added various missing private and readonly modifiers.
Configuration menu - View commit details
-
Copy full SHA for b92bb7e - Browse repository at this point
Copy the full SHA b92bb7eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3cbec48 - Browse repository at this point
Copy the full SHA 3cbec48View commit details
Commits on May 5, 2023
-
Re-enable IDE0060 (remove unused parameters)
Added suppressions in cases where unused parameters are present by design.
Configuration menu - View commit details
-
Copy full SHA for 4776b87 - Browse repository at this point
Copy the full SHA 4776b87View commit details -
Configuration menu - View commit details
-
Copy full SHA for e4c0ccd - Browse repository at this point
Copy the full SHA e4c0ccdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8f5749d - Browse repository at this point
Copy the full SHA 8f5749dView commit details -
Configuration menu - View commit details
-
Copy full SHA for ad8a973 - Browse repository at this point
Copy the full SHA ad8a973View commit details -
Configuration menu - View commit details
-
Copy full SHA for 873edad - Browse repository at this point
Copy the full SHA 873edadView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4d0d04c - Browse repository at this point
Copy the full SHA 4d0d04cView commit details -
Configuration menu - View commit details
-
Copy full SHA for ca4f3c4 - Browse repository at this point
Copy the full SHA ca4f3c4View commit details
Commits on May 9, 2023
-
Re-enable IDE0076 (invalid suppression target)
Removed a load of CA1062 suppressions because that warning applies to public members (it checks that arguments are checked) but it had been applied to a load of non-public members.
Configuration menu - View commit details
-
Copy full SHA for fd731bd - Browse repository at this point
Copy the full SHA fd731bdView commit details -
Re-enable IDE0077 (legacy target format in suppressions)
Updated the SuppressMessage attributes in question to use the modern format.
Configuration menu - View commit details
-
Copy full SHA for 8b38288 - Browse repository at this point
Copy the full SHA 8b38288View commit details
Commits on May 10, 2023
-
Move over more comprehensively to Roslyn analyzers. (It's not clear whether the old style analyzers were still running before. But some of the suppressions were causing problems.)
Configuration menu - View commit details
-
Copy full SHA for 05b956b - Browse repository at this point
Copy the full SHA 05b956bView commit details
Commits on May 11, 2023
-
Configuration menu - View commit details
-
Copy full SHA for ed3e1eb - Browse repository at this point
Copy the full SHA ed3e1ebView commit details -
Re-enable IDE0280 (use nameof)
Tweaks to scoping rules in C# 11.0 mean we can now use `nameof` in a few cases where it used not to work. (Method parameter names are now in scope in parameter and return: attributes.)
Configuration menu - View commit details
-
Copy full SHA for 7a68291 - Browse repository at this point
Copy the full SHA 7a68291View commit details -
I think this one was a typo - currently there is no such diagnostic.
Configuration menu - View commit details
-
Copy full SHA for f7735aa - Browse repository at this point
Copy the full SHA f7735aaView commit details -
Configuration menu - View commit details
-
Copy full SHA for a25aa21 - Browse repository at this point
Copy the full SHA a25aa21View commit details -
Configuration menu - View commit details
-
Copy full SHA for a89b22b - Browse repository at this point
Copy the full SHA a89b22bView commit details -
Configuration menu - View commit details
-
Copy full SHA for c27ef2e - Browse repository at this point
Copy the full SHA c27ef2eView commit details