Commit Graph
17 Commits
Author SHA1 Message Date
David Cantu bcf3bd30ad Fix concurrent collections CA1836 rule violations (#40629)
* Fix concurrent collections CA1836 rule violations

* Update dogfood analyzer version
2020-08-10 18:12:52 -07:00
Stephen Toub aa5fdab965 Update Microsoft.CodeAnalysis.NetAnalyzers to 3.3.0-beta3.20407.4 (#40560) 2020-08-09 05:32:44 -04:00
Carlos Sanchez Lopez 7f34be5319 Apply CA2016: Forward CancellationToken to methods that can take it (#37607)
* Forward CancellationToken to methods that can take it

* Address suggestions

* address suggestions

* Revert using

* Make rule 2016 a warning in runtime

* Extra cases found

* Revert changes that should not pass a token, change rule to info to verify build and test CI results

* Pass CancellationToken.None to base.CreateContentReadStreamAsync, as in its default overload

* Address stack overflow in MultipartContent

* HostingAbstractionsHostExtensions address using

* Update nuget package version to latest, Info->Warning again, fix one more case.

* System.Diagnostics.ProcessWaitState.Unix token

* Remove two unnecessary tokens
2020-07-15 13:10:46 -07:00
Stephen Toub 68eb040669 Enable SA1404 Code analysis suppression should have justification (#38537) 2020-07-02 20:45:55 -04:00
buyaa-n 06fa9410a8 Turn on argument exception analyzer on runtime, fix warnings found (#38578)
* Turn on argument exception analyzer on runtime, fix failures found
2020-07-01 18:36:56 -07:00
Stephen Toub 3c9fcce29d Disable P/Invoke analyzer (#38550) 2020-06-29 18:06:21 -04:00
Stephen Toub 0ab928b27b Enable CA1805 (#38471) 2020-06-27 16:15:36 -04:00
Stephen Toub 8b36909054 Switch to new Microsoft.CodeAnalysis.NetAnalyzers package (#38346)
And update to the latest beta bits available.
2020-06-25 14:01:46 -04:00
Levi Broderick 997539e7d3 Obsolete PrincipalPermissionAttribute ctor as error (#37536) 2020-06-17 18:57:32 -07:00
buyaa-n ee0aadc3da Fix argument exception warnings on runtime (#35717)
* Fix argument exception warnings on runtime

* Apply feedback

* Addressing feedback and test fix

* Fix test failures

* Fix tests for NetFx run

* Fix suppressed warning for socket.SendAsyn(e) and fix corresponding tests

* Applied feedback
2020-05-15 16:55:30 -04:00
Stephen Toub 83e56c474a Update to v3.0.0 of Microsoft.CodeAnalysis.FxCopAnalyzers (#36318) 2020-05-13 17:07:11 -04:00
Alex Villarreal 61733e21bb Enable xunit1024 (#34512)
* Enable analyzer rule xUnit1024

* Remove redundant test in System.Text.Json

The very next method is a Theory with inline data that tests this
exact scenario.

* Rename test methods in System.Text.Json

* Rename test methods in System.ComponentModel.Annotations

* Private methods -> local functions in System.Text.Json

* Rename test methods in System.Collections.Immutable

For RemoveNonExistingTest, just moved the logic from the single-use
helper into the method with the Fact attribute.

* Rename test methods in System.Globalization

* Rename test methods in System.Runtime.Extensions

In Math.cs, removed Round_Decimal_Digits Fact which manually tested
cases included in the MemberData of a Theory with the same name.

* Rename test methods in System.Private.Uri

* Rename test methods in System.Runtime.WindowsRuntime.UI.Xaml

* Rename test methods in System.Security.Cryptography.X509Certificates

* Rename test methods in System.Reflection

* Remove redundant test in System.IO.FileSystem.Watcher

Theory EndInit_ResumesPausedEnableRaisingEvents alredy tests
the same scenario as the removed Fact of the same name.

* Rename test methods in System.IO.FileSystem.Watcher

* Rename test methods in System.Composition.Runtime

* Rename test methods in System.Drawing.Primitives

* Rename test methods in System.Reflection.Emit

* Rename test methods in System.Text.RegularExpressions

* Private methods -> local functions in System.Threading.Tasks.Parallel

* Rename test methods in System.Threading.Tasks.Parallel

* Rename test methods in System.Threading.Tasks

* Simplify tests in System.Threading

* Rename test methods in System.Threading

* Rename test methods in Microsoft.VisualBasic.Core

* Rename test methods in System.DirectoryServices.AccountManagement

* Private methods -> local functions in System.Text.Encoding

* Rename test methods in System.Text.Encoding

* Rename test methods in System.Security.Cryptography.Primitives

* Rename test methods in System.Runtime.Numeric

* Rename test methods in System.CodeDom.Tests

* Rename test methods in System.Reflection.Emit.ILGeneration

* Rename test methods in System.Composition.AttributedModel

* Rename test methods in System.Data.DataSetExtensions

* Rename test methods in System.Runtime

* Rename test methods in System.Runtime.InteropServices

* Remove redundant test in System.ServiceModel.Syndication

* Rename test methods in System.ServiceModel.Syndication

* Rename test methods in System.Data.Common

* Rename test methods in System.Security.Cryptography.Xml

* Private methods -> local functions in System.Security.Cryptography.Xml

* Simplify tests in System.Security.Cryptography.ProtectedData

* Replace private methods with local functions...

In System.Security.Cryptography.Algorithms

* Rename test methods in System.Security.Cryptography.Algorithms

* Simplify tests code in System.Collections.Concurrent

* Rename test methods in System.Drawing.Common

* Rename test methods in System.Data.OleDb

* Rename test methods in System.ComponentModel.TypeConverter

* Rename test methods in System.Web.HttpUtility

* Rename test methods in System.Linq

* Private method -> local function in System.Linq

* Rename test methods in System.Memory

* Rename test methods in System.IO.IsolatedStorage

* Rename test methods in System.DirectoryServices.Protocols

* Rename test methods in System.Globalization.Extensions

* Private methods -> local functions in System.Globalization.Extensions

* Rename test methods in System.IO.Compression

* Rename test methods in System.Security.Cryptography.Encoding

* Rename test methods in Microsoft.Win32.Registry

* Rename test methods in System.IO.UnmanagedMemoryStream

* Rename test methods in System.Collections

* Rename test methods in System.Collections.Specialized

* Rename test methods in System.Private.Xml

* Rename test methods in System.IO.FileSystem

* Rename test methods in System.Diagnostics.StackTrace

* Rename test methods in System.Diagnostics

* Improve some test method renames

* Minor nit fixing

* More improvements to test method names
2020-04-08 06:58:54 -04:00
Stephen Toub d1006ce950 Update analyzer versions and fix violations (#34041) 2020-03-24 22:00:45 -04:00
Stephen Toub 864b84f6af Re-disable CA2010 (#32872)
Apparently there were missed warnings that are now being treated as errors due to a PR that raced with mine yesterday to update the CodeAnalysis.ruleset file.
2020-02-26 11:33:53 -05:00
Stephen Toub 359f19db96 Update CodeAnalysis.ruleset to list every roslyn analyzers rule (#32814) 2020-02-25 16:58:19 -05:00
Stephen Toub 5d9c9daf0d Enable CA1827 (use Any() instead of Count() compared to 0) (#31983) 2020-02-08 20:01:59 -05:00
Viktor Hofer 6afe96cc2e Converge common msbuild properties and targets (#338)
* Converge common msbuild properties and targets

Moving common msbuild properties and targets into the repo root.

* Consolidate analyzers logic into the repo root

Consolidating msbuild analyzers logic centrally in the repo root and
adding a property switch `EnableAnalyzers` to enable analyzers. We
still need to import the Analyzers.props file unconditionally as
libraries currently doesn't use the PackageReference logic in ref and
src projects and instead uses a depproj to create a props file
dynamically.

* More cleanup to fix CoreLib build
2019-12-01 11:01:39 +01:00