However, I'm not enabling the rule permanently, as it disagrees with VS IDE0055 about the spacing around semicolons at the end of empty while and for loops.
Because this also impacts `for (;;)` loops, I also searched and replaced those with `while (true)`, to standardize on that across the codebase.
Commit migrated from https://github.com/dotnet/corefx/commit/93285e4511a9656a30b92b8b6a9088608aac40e0
Mechanical/automated change. The only manual changes were a) removing the two rules from the CodeAnalysis.ruleset file, b) removing spaces from one line of a .targets file that is used to generate a .cs file, and c) reverting the changes in a few test files where the naive replacement happened in the middle of a verbatim string where the whitespace actually mattered.
Commit migrated from https://github.com/dotnet/corefx/commit/09a6e66b0c2b31bd0f6e7e3170537d14027aeed0
* Re-enable xunit warning 1026 (unused theory arguments)
Some of these were addressed by explicitly discarding theory arguments, generally in cases where either a) the argument was being used as a description to aid in debugging failures, or b) the argument was part of a member data that was used by some theories and not by others all sharing the same member data.
However, there are quite a few legitimate bugs being fixed here, enough that highlights it's worthwhile to have the rule enabled. Some are cases where the argument was supposed to be used but wasn't. Some are cases where the argument isn't used at all, and in many cases where we end up running the same test over and over and wasting cycles. Some are cases where we're unnecessarily including irrelevant inputs to the tests and making the input data more complicated than it needs to be. Etc.
(Along the way, I also fixed some cases where VS was warning about lambdas being used instead of local functions, and in cases where I agreed I fixed them, via auto-fixers.)
* Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/daf93ee0e5e5233141eb762c64b6049cfd7d123e
* Fix ordering of keywords in member signatures
* Add StyeCop.Analyzers
Most rules are disabled. Many of them we'll want to leave disabled, however there are a handful it'll be good to enable over time.
* Use built-in type alias
* Fix straggling stylecop warnings in all configurations
* Replace tabs with spaces
Commit migrated from https://github.com/dotnet/corefx/commit/a12c557a72988070b8624cc7ecc46899629895c4
* Clean up lots of string.Format usage
This PR does a few things:
- Adds new SR.Format overloads, in particular to support accepting an IFormatProvider as the first argument.
- Fixes a bunch of calls to string.Format that should have been using SR.Format. This not only helps in AOT builds where we want to be able to more cleanly remove resource strings, it enables easier auditing of the remaining string.Format uses to determine whether there are more appropriate implementations.
- Replaces some string.Format uses, in particular in asserts, with easier to read and maintain string interpolation
- Replaces some string.Format uses with string concatenation where it's simple and cheaper
- Fixes a bunch of SR.Format(SR.Something) calls where the SR.Format part is extraneous and should just be removed.
- Replaces a bunch of Debug.Assert(false, ...) calls with Debug.Fail(...). This isn't directly related to string.Format, but I started this cleanup as part of cleaning up asserts that were using string.Format, and then ended up accidentally merging the chain into the same commit, and decided it was simple enough that I should just leave it rather than trying to separate it out again.
* Address PR feedback
* Fix breaks due to lower netstandard builds
Commit migrated from https://github.com/dotnet/corefx/commit/a6f76f4f620cbe74821c6445af3f13e048361658
* Removing Reference assets from packages which contain runtime-specific dependencies when targeting Desktop. (dotnet/corefx#33254)
* Removing Reference assets from packages which contain runtime-specific dependencies when targeting Desktop.
* Adding validation target to catch other instances of packages that need the property
* Fixing target to check all exclude compiles. Undoing changes on two packages that are not required any more.
* Update package index to contain the right versions
* Fixing packaging build errors
Commit migrated from https://github.com/dotnet/corefx/commit/6832425094123c858b9e5da02469c98ca8c200c4
* Fix allocated Encoding memory initialization
We allocate native memory using GlobalHAlloc which usually doesn’t zero out the allocated memory and that cause a problem when using this memory. We fixed similar issue before in SBCS but looks we missed the DBCS one.
* Use Unsafe.InitBlockUnaligned
* remove un-needed empty line
* remove space
* Include System.Runtime.CompilerServices.Unsafe to inbox packag
* fix package build breaks
Commit migrated from https://github.com/dotnet/corefx/commit/d5b142984587ac3c1b8562a76c83d5dede117289
* Stabilize configurations for Microsoft.Win32.Registry
* Stabilize configurations for System.IO.FileSystem.AccessControl
* Stabilize configurations for System.IO.Packaging
* Stabilize configurations for System.Security.AccessControl
* Stabilize configurations for System.Principal.Windows
* Stabilize configurations for System.ServiceProcess.ServiceController
* Stabilize configurations for System.Text.Encoding.CodePages
* Some extra cleanup
* Fix CI failures
Commit migrated from https://github.com/dotnet/corefx/commit/39cdb933600c5dcdec1157b8d5755ec37950e2e0
Many library packages overlap with assemblies we include in our framework packages.
In the first release we handled this by preventing the library package from applying any
assets.
This becomes problematic if the reference assembly needs to version, and especially
if the library wants to add API. The new version will be greater than what was previously
shipped inbox, and we wouldn't want to restrict the new version just to future TFMs.
To address this problem I've made a couple fixes:
1. For packages which are shipping brand new API that's not present in desktop, we'll
omit any placeholders and allow conflict resolution to decide if the library package
or framework package should be used (based on version). In some cases this required
bringing some configurations into the package so that it could always be "up to date".
2. For packages which are just exposing API in desktop, and thus already tied/anchored
to netstandard versions, we'll freeze the reference assembly version for the non-desktop
builds. This ensures that the reference assembly will never move past the version that's
inbox in the framework package.
Update BuildToolsVersion to 2.0.0-prerelease-01931-01
Commit migrated from https://github.com/dotnet/corefx/commit/7ee51be7ed472a12266c8cc2ab25a9e1862c1d00
* Moving PlatformDetection to Corefx.Private.TestUtilities assembly
The purpose of this change is to clean up all test projects instead of including the PlatformDetection code inside every test project, we’ll have it in the Corefx.Private.TestUtilities.
I have refactored the PlatformDetection to split the different implementation of Windows and Linux. If we need to do more refactoring there we can do it later as needed.
* Fix Linux BB
* Update the xunit package reference
* Fix wrong condition on one of the tests
* Update the ConditionalFact/Theory to use Type as a parameter
Commit migrated from https://github.com/dotnet/corefx/commit/878e2fcf5a9f1068015e5fada9231088663e3490