Skip to content

Commit

Permalink
Run dotnet format whitespace (#3307)
Browse files Browse the repository at this point in the history
Co-authored-by: Amaury Levé <amauryleve@microsoft.com>
  • Loading branch information
Evangelink and Evangelink authored Feb 4, 2022
1 parent 909b4f8 commit cf2bd92
Show file tree
Hide file tree
Showing 945 changed files with 970 additions and 974 deletions.
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ indent_size = 2
indent_size = 4
tab_width = 4

# New line preferences
insert_final_newline = false

#### .NET Coding Conventions ####

# Organize usings
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,3 @@ Please see [issue tracking](https://github.com/Microsoft/vstest-docs/blob/main/i

### Roadmap
For more information on shipped and upcoming features/enhancements please refer to our [Releases](https://github.com/Microsoft/vstest-docs/blob/main/docs/releases.md) and [Quarterly Checkin reports](https://github.com/Microsoft/vstest-docs/tree/main/Quarterly%20Checkins)

2 changes: 1 addition & 1 deletion playground/MSTest1/UnitTest1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ public class UnitTest1
public void TestMethod1()
{
}
}
}
2 changes: 1 addition & 1 deletion playground/TestPlatform.Playground/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,4 @@ public int LaunchTestHost(TestProcessStartInfo defaultTestHostStartInfo, Cancell
return 1;
}
}
}
}
2 changes: 1 addition & 1 deletion scripts/build/ExternalAssemblyVersions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ internal class ExternalAssemblyVersions
/// The Package version can be found in "scripts\build\TestPlatform.Dependencies.props"
/// </summary>
internal const string MicrosoftFakesAssemblyVersion = "17.0.0.0";
}
}
50 changes: 25 additions & 25 deletions scripts/common.lib.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ $TPB_BRANCH = "LOCALBRANCH"
$TPB_COMMIT = "LOCALBUILD"

try {
$TPB_BRANCH = $env:BUILD_SOURCEBRANCH -replace "^refs/heads/"
if ([string]::IsNullOrWhiteSpace($TPB_BRANCH)) {
$TPB_BRANCH = $env:BUILD_SOURCEBRANCH -replace "^refs/heads/"
if ([string]::IsNullOrWhiteSpace($TPB_BRANCH)) {
$TPB_BRANCH = git -C "." rev-parse --abbrev-ref HEAD
}
}
catch { }

try {
$TPB_COMMIT = $env:BUILD_SOURCEVERSION
if ([string]::IsNullOrWhiteSpace($TPB_COMMIT)) {
if ([string]::IsNullOrWhiteSpace($TPB_COMMIT)) {
$TPB_COMMIT = git -C "." rev-parse HEAD
}
}
Expand All @@ -42,9 +42,9 @@ $GlobalJson = Get-Content -Raw -Path (Join-Path $env:TP_ROOT_DIR 'global.json')
#
# Dotnet configuration
#
# Disable first run since we want to control all package sources
# Disable first run since we want to control all package sources
Write-Verbose "Setup dotnet configuration."
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
# Dotnet build doesn't support --packages yet. See https://github.com/dotnet/cli/issues/2712
$env:NUGET_PACKAGES = $env:TP_PACKAGES_DIR
$env:NUGET_EXE_Version = "5.8.1"
Expand All @@ -60,7 +60,7 @@ function Write-Log {
[string]
$Level = "Success"
)

$currentColor = $Host.UI.RawUI.ForegroundColor
try {
$Host.UI.RawUI.ForegroundColor = if ("Success" -eq $Level) { "Green" } else { "Red" }
Expand Down Expand Up @@ -119,7 +119,7 @@ function Install-DotNetCli

& $dotnetInstallScript -InstallDir "${dotnetInstallPath}_x86" -Runtime 'dotnet' -Version '2.1.30' -Channel '2.1' -Architecture x86 -NoPath
${env:DOTNET_ROOT(x86)} = "${dotnetInstallPath}_x86"

& $dotnetInstallScript -InstallDir "$dotnetInstallPath" -Runtime 'dotnet' -Version '3.1.22' -Channel '3.1' -Architecture x64 -NoPath
$env:DOTNET_ROOT= $dotnetInstallPath

Expand All @@ -136,7 +136,7 @@ function Install-DotNetCli

"---- dotnet environment variables"
Get-ChildItem "Env:\dotnet_*"

"`n`n---- x64 dotnet"
Invoke-Exe "$env:DOTNET_ROOT\dotnet.exe" -Arguments "--info"

Expand All @@ -150,10 +150,10 @@ function Install-DotNetCli

function Clear-Package {
# find all microsoft packages that have the same version as we specified
# this is cache-busting the nuget packages, so we don't reuse them from cache
# this is cache-busting the nuget packages, so we don't reuse them from cache
# after we built new ones
if (Test-Path $env:TP_PACKAGES_DIR) {
$devPackages = Get-ChildItem $env:TP_PACKAGES_DIR/microsoft.*/$TPB_Version | Select-Object -ExpandProperty FullName
$devPackages = Get-ChildItem $env:TP_PACKAGES_DIR/microsoft.*/$TPB_Version | Select-Object -ExpandProperty FullName
$devPackages | Remove-Item -Force -Recurse -Confirm:$false
}
}
Expand All @@ -173,11 +173,11 @@ function Copy-Bulk {
[string]$root,
[hashtable]$files
)

$files.GetEnumerator() | ForEach-Object {
$from = Join-Path $root $_.Name
$to = $_.Value

New-Item -ItemType directory -Path "$to\" -Force | Out-Null
Copy-Item "$from\*" $to -Force -Recurse
}
Expand Down Expand Up @@ -237,27 +237,27 @@ function Invoke-Exe {
if($CaptureOutput)
{
$process.StdErr
}
}
Set-ScriptFailedOnError -Command $Command -Arguments $Arguments
}

if($CaptureOutput)
{
$process.StdOut
}
}
}

Add-Type -TypeDefinition @'
using System;
using System.Text;
using System.Collections.Generic;
public class ProcessOutputter {
public class ProcessOutputter {
private readonly ConsoleColor _color;
private readonly List<string> _output;
private int nullCount = 0;
public ProcessOutputter (ConsoleColor color, bool suppressOutput = false) {
public ProcessOutputter (ConsoleColor color, bool suppressOutput = false) {
_color = color;
_output = new List<string>();
Expand All @@ -272,14 +272,14 @@ public class ProcessOutputter {
Console.WriteLine(e.Data);
}
finally
{
{
Console.ForegroundColor = fg;
}
}
};
}
public ProcessOutputter () {
public ProcessOutputter () {
_output = new List<string>();
OutputHandler = (s, e) => AppendLine(e.Data);
}
Expand All @@ -297,7 +297,7 @@ public class ProcessOutputter {
--nullCount;
_output.Add(string.Empty);
}
_output.Add(line);
}
}
Expand All @@ -317,15 +317,15 @@ function Start-InlineProcess {
[switch]
$Elevate,

[switch]
[switch]
$SuppressOutput
)

$processInfo = [System.Diagnostics.ProcessStartInfo]::new()
$processInfo.FileName = $Path
$processInfo.Arguments = $Arguments
$processInfo.WorkingDirectory = $WorkingDirectory

$processInfo.RedirectStandardError = $true
$processInfo.RedirectStandardOutput = $true
$processInfo.UseShellExecute = $false
Expand Down Expand Up @@ -364,4 +364,4 @@ function Start-InlineProcess {
$process.remove_ErrorDataReceived($errorDataReceived)
$process.Dispose()
}
}
}
2 changes: 1 addition & 1 deletion scripts/vstest-codecoverage.runsettings
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>
</RunSettings>
2 changes: 1 addition & 1 deletion scripts/vstest-codecoverage2.runsettings
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>
</RunSettings>
8 changes: 4 additions & 4 deletions scripts/vsts-prebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -o nounset # Fail on uninitialized variables.
set -e # Fail on non-zero exit code.

# Parameter
TP_BUILD_SUFFIX="dev"
TP_BUILD_SUFFIX="dev"
BRANCH=
IS_RTM=false

Expand Down Expand Up @@ -40,13 +40,13 @@ if [ $IS_RTM == true ]; then
PACKAGE_VERSION="$TP_BUILD_PREFIX"
TP_BUILD_SUFFIX=
else
if [ ! -z "$BRANCH" ] && [[ $BRANCH =~ ^refs\/heads\/rel\/.*$ ]]; then
if [ ! -z "$BRANCH" ] && [[ $BRANCH =~ ^refs\/heads\/rel\/.*$ ]]; then
TP_BUILD_SUFFIX="${TP_BUILD_SUFFIX/preview/release}"
fi
fi

PACKAGE_VERSION="$TP_BUILD_PREFIX-$TP_BUILD_SUFFIX"
fi

echo "##vso[task.setvariable variable=BuildVersionPrefix;]$TP_BUILD_PREFIX"
echo "##vso[task.setvariable variable=BuildVersionSuffix;]$TP_BUILD_SUFFIX"
echo "##vso[task.setvariable variable=PackageVersion;]$PACKAGE_VERSION"
echo "##vso[task.setvariable variable=PackageVersion;]$PACKAGE_VERSION"
2 changes: 1 addition & 1 deletion src/AttachVS/AttachVs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,4 +295,4 @@ private static extern int NtQueryInformationProcess(

[DllImport("ole32.dll")]
private static extern int CreateBindCtx(uint reserved, out IBindCtx ppbc);
}
}
2 changes: 1 addition & 1 deletion src/AttachVS/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ static void Main(string[] args)
: null;
return pid;
}
}
}
2 changes: 1 addition & 1 deletion src/DataCollectors/DumpMinitool/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,4 @@ internal static void WaitForDebugger(string environmentVariable)
Debugger.Break();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,4 @@ public string this[string name]
set => NameValuePairs[name] = value;
}
#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ public EventLogCollectorException(string localizedMessage, Exception innerExcept
: base(localizedMessage, innerException)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ internal static class EventLogConstants

public const int TypeColumnMaxLength = 64;
public const int SourceColumnMaxLength = 212;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,4 @@ protected virtual void Dispose(bool disposing)
_isDisposed = true;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -631,4 +631,4 @@ private EventLogSessionContext GetEventLogSessionContext(DataCollectionContext d
}

#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ public void CreateEventLogContainerStartIndexMap()
EventLogContainerStartIndexMap.Add(kvp.Key, kvp.Value.EventLogEntries.Count);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ public static void WriteEventLogEntriesToXmlFile(string xmlFilePath, List<EventL
fileHelper.WriteAllTextToFile(xmlFilePath, stringBuilder.ToString());
}
}
#endregion
#endregion
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

[assembly: InternalsVisibleTo("Microsoft.TestPlatform.Extensions.EventLogCollector.UnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]
#endregion
#endregion
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ internal interface IEventLogContainer : IDisposable
/// Contains data related to EventLog entry.
/// </param>
void OnEventLogEntryWritten(object source, EntryWrittenEventArgs e);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("4c1f0d81-67a9-4bf3-a006-615ab4a7fcd6")]

[assembly: TestExtensionTypes(typeof(EventLogDataCollector))]
[assembly: TestExtensionTypes(typeof(EventLogDataCollector))]
2 changes: 1 addition & 1 deletion src/Microsoft.TestPlatform.AdapterUtilities/Friends.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("Microsoft.TestPlatform.AdapterUtilities.UnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
[assembly: InternalsVisibleTo("Microsoft.TestPlatform.AdapterUtilities.UnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ public static class Levels
/// </summary>
public const int ClassIndex = 1;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ public static class ManagedNameConstants
/// Property id to use on ManagedMethod test property.
/// </summary>
public const string ManagedMethodPropertyId = "TestCase." + ManagedMethodLabel;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -367,4 +367,4 @@ public void ProcessBlock(byte[] message, int start, int length)
_h[4] += e;
}
}
}
}
2 changes: 1 addition & 1 deletion src/Microsoft.TestPlatform.Build/ArgumentEscaper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ internal static bool IsSurroundedWithQuotes(string argument)

internal static bool ArgumentContainsWhitespace(string argument)
=> argument.Contains(" ") || argument.Contains("\t") || argument.Contains("\n");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ public void Cancel()
Tracing.Trace(string.Format("VSTest: Killing process throws ArgumentException with the following message {0}. It may be that process is not running", ex));
}
}
}
}
2 changes: 1 addition & 1 deletion src/Microsoft.TestPlatform.Build/Tasks/VSTestLogsTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ public override bool Execute()

return true;
}
}
}
2 changes: 1 addition & 1 deletion src/Microsoft.TestPlatform.Build/Tasks/VSTestTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -418,4 +418,4 @@ private List<string> AddArgs()

return allArgs;
}
}
}
Loading

0 comments on commit cf2bd92

Please sign in to comment.