Skip to content

Commit

Permalink
Ran the dotnet format command on sdk.sln. Resolved any build issues i…
Browse files Browse the repository at this point in the history
…t created.
  • Loading branch information
MiYanni committed Aug 16, 2023
1 parent 15ccb72 commit f65053d
Show file tree
Hide file tree
Showing 559 changed files with 1,885 additions and 1,728 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public bool LogError(Suppression suppression, string code, string message)

HasLoggedErrorSuppressions = true;
LogError(code, message);

return true;
}

Expand All @@ -40,9 +40,9 @@ public bool LogWarning(Suppression suppression, string code, string message)
{
if (_suppressionEngine.IsErrorSuppressed(suppression))
return false;

LogWarning(code, message);

return true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.CodeAnalysis;
using Microsoft.DotNet.ApiCompatibility.Comparing;
using Microsoft.DotNet.ApiCompatibility.Mapping;
using Microsoft.DotNet.ApiCompatibility.Rules;
using Microsoft.DotNet.ApiCompatibility.Comparing;
using Microsoft.DotNet.ApiSymbolExtensions.Filtering;

namespace Microsoft.DotNet.ApiCompatibility
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ informational message to prevent user errors (i.e. wrong input to the frontend).
rightMetadata.DisplayString,
rightIdentity));
}

if (rightAssemblyVersion < leftAssemblyVersion)
{
differences.Add(CreateIdentityDifference(
Expand Down Expand Up @@ -139,7 +139,7 @@ informational message to prevent user errors (i.e. wrong input to the frontend).
leftMetadata,
rightMetadata,
Resources.AssemblyPublicKeyTokenDoesNotMatch,
GetStringRepresentation(leftAssemblyPublicKeyToken),
GetStringRepresentation(leftAssemblyPublicKeyToken),
GetStringRepresentation(rightAssemblyPublicKeyToken),
leftMetadata.DisplayString,
rightMetadata.DisplayString,
Expand All @@ -151,7 +151,7 @@ informational message to prevent user errors (i.e. wrong input to the frontend).
leftMetadata,
rightMetadata,
Resources.AssemblyPublicKeyTokenDoesNotMatch,
GetStringRepresentation(rightAssemblyPublicKeyToken),
GetStringRepresentation(rightAssemblyPublicKeyToken),
GetStringRepresentation(leftAssemblyPublicKeyToken),
rightMetadata.DisplayString,
leftMetadata.DisplayString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private void ValidateBaseTypeNotRemoved(ITypeSymbol left, ITypeSymbol right, str

rightBaseType = rightBaseType.BaseType;
}

differences.Add(new CompatDifference(
leftMetadata,
rightMetadata,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void ExecuteWorkItems()
IApiComparer apiComparer = _apiComparerFactory.Create();
apiComparer.Settings.StrictMode = workItem.Options.EnableStrictMode;
apiComparer.Settings.WithReferences = runWithReferences;


// Invoke the api comparer for the work item and operate on the difference result
IEnumerable<CompatDifference> differences = apiComparer.GetDifferences(leftContainerList, rightContainersList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ public void WriteBootJson(Stream output, string entryAssemblyName)
if (IsLazyLoadedAssembly($"{fileName}.dll"))
{
resourceList = resourceData.lazyAssembly;
} else {
}
else
{
resourceList = resourceData.pdb;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/BuiltInTools/dotnet-watch/DotNetWatchOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal sealed record DotNetWatchOptions(
);

public bool NonInteractive { get; set; }

public bool RunningAsTest { get => ((TestFlags & TestFlags.RunningAsTest) != TestFlags.None); }

private static bool IsEnvironmentSet(string key)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public override void Initialize(DotNetWatchContext context, CancellationToken ca
_wasmApplier.Initialize(context, cancellationToken);
_hostApplier.Initialize(context, cancellationToken);
}

public override async Task<ApplyStatus> Apply(DotNetWatchContext context, ImmutableArray<WatchHotReloadService.Update> updates, CancellationToken cancellationToken)
{
// Apply to both processes.
Expand Down Expand Up @@ -63,7 +63,7 @@ static void ReportStatus(IReporter reporter, ApplyStatus status, string target)
}
}
}

public override void Dispose()
{
_hostApplier.Dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/BuiltInTools/dotnet-watch/HotReload/RudeEditDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public async Task EvaluateAsync(CancellationToken cancellationToken)
"Do you want to restart your app - Yes (y) / No (n) / Always (a) / Never (v)?",
KeyPressed,
cancellationToken);

switch (key)
{
case ConsoleKey.Escape:
Expand Down
4 changes: 2 additions & 2 deletions src/BuiltInTools/dotnet-watch/Internal/ConsoleRequester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public async Task<ConsoleKey> GetKeyAsync(string prompt, Func<ConsoleKey, bool>
Console.Out.Write($" {questionMark} ");
Console.ResetColor();
}

var tcs = new TaskCompletionSource<ConsoleKey>(TaskCreationOptions.RunContinuationsAsynchronously);
Console.KeyPressed += KeyPressed;
try
Expand Down Expand Up @@ -75,7 +75,7 @@ void KeyPressed(ConsoleKeyInfo key)
}
}
}

void WriteLine(string message, ConsoleColor color = ConsoleColor.DarkGray)
{
lock (_writeLock)
Expand Down
2 changes: 1 addition & 1 deletion src/BuiltInTools/dotnet-watch/Internal/OutputCapture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ internal sealed class OutputCapture
public IEnumerable<string> Lines => _lines;
public void AddLine(string line) => _lines.Add(line);
}
}
}
2 changes: 1 addition & 1 deletion src/BuiltInTools/dotnet-watch/Internal/OutputSink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ public OutputCapture StartCapture()
return (Current = new OutputCapture());
}
}
}
}
8 changes: 4 additions & 4 deletions src/Cli/Microsoft.DotNet.Cli.Sln.Internal/SlnFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

using System.Collections;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Collections;
using System.Globalization;
using System.Reflection;
using Microsoft.DotNet.Cli.Sln.Internal.FileManipulation;
Expand Down Expand Up @@ -404,8 +404,8 @@ public bool IsEmpty
{
get
{
return (_properties == null || _properties.Count == 0) &&
(_nestedPropertySets == null || _nestedPropertySets.All(t => t.IsEmpty)) &&
return (_properties == null || _properties.Count == 0) &&
(_nestedPropertySets == null || _nestedPropertySets.All(t => t.IsEmpty)) &&
(_sectionLines == null || _sectionLines.Count == 0);
}
}
Expand Down Expand Up @@ -503,7 +503,7 @@ private SlnSectionType ToSectionType(int curLineNum, string s)
return SlnSectionType.PostProcess;
}
throw new InvalidSolutionFormatException(
curLineNum,
curLineNum,
String.Format(LocalizableStrings.InvalidSectionTypeError, s));
}

Expand Down
24 changes: 12 additions & 12 deletions src/Cli/Microsoft.DotNet.Cli.Utils/AnsiConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,29 @@ public class AnsiConsole
private AnsiConsole(TextWriter writer)
{
Writer = writer;

OriginalForegroundColor = Console.ForegroundColor;
_boldRecursion = ((int)OriginalForegroundColor & Light) != 0 ? 1 : 0;

_ansiEnabled = string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("NO_COLOR"));
}

private int _boldRecursion;

public static AnsiConsole GetOutput()
{
return new AnsiConsole(Console.Out);
}

public static AnsiConsole GetError()
{
return new AnsiConsole(Console.Error);
}

public TextWriter Writer { get; }

public ConsoleColor OriginalForegroundColor { get; }

private void SetColor(ConsoleColor color)
{
if (!_ansiEnabled)
Expand All @@ -43,12 +43,12 @@ private void SetColor(ConsoleColor color)

int c = (int)color;

Console.ForegroundColor =
Console.ForegroundColor =
c < 0 ? color : // unknown, just use it
_boldRecursion > 0 ? (ConsoleColor)(c | Light) : // ensure color is light
(ConsoleColor)(c & ~Light); // ensure color is dark
}

private void SetBold(bool bold)
{
if (!_ansiEnabled)
Expand All @@ -61,7 +61,7 @@ private void SetBold(bool bold)
{
return;
}

// switches on _boldRecursion to handle boldness
SetColor(Console.ForegroundColor);
}
Expand All @@ -76,7 +76,7 @@ public void WriteLine(string message)
public void Write(string message)
{
var escapeScan = 0;
for (;;)
for (; ; )
{
var escapeIndex = message.IndexOf("\x1b[", escapeScan, StringComparison.Ordinal);
if (escapeIndex == -1)
Expand All @@ -95,7 +95,7 @@ public void Write(string message)
{
endIndex += 1;
}

var text = message.Substring(escapeScan, escapeIndex - escapeScan);
Writer.Write(text);
if (endIndex == message.Length)
Expand Down Expand Up @@ -148,7 +148,7 @@ public void Write(string message)
}
break;
}

escapeScan = endIndex + 1;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Cli/Microsoft.DotNet.Cli.Utils/ArgumentEscaper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static class ArgumentEscaper
/// <param name="args"></param>
/// <returns></returns>
public static string EscapeAndConcatenateArgArrayForProcessStart(IEnumerable<string> args)
{
{
var escaped = EscapeArgArray(args);
#if NET35
return string.Join(" ", escaped.ToArray());
Expand Down Expand Up @@ -137,7 +137,7 @@ public static string EscapeSingleArg(string arg)
sb.Append(arg[i]);
}
}

if (needsQuotes) sb.Append("\"");

return sb.ToString();
Expand Down
2 changes: 1 addition & 1 deletion src/Cli/Microsoft.DotNet.Cli.Utils/BuiltInCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public ICommand CaptureStdErr()
public ICommand CaptureStdOut()
{
_stdOut.Capture();

return this;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Cli/Microsoft.DotNet.Cli.Utils/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public CommandResult Execute(Action<Process> processStarted)

#if DEBUG
var sw = Stopwatch.StartNew();

Reporter.Verbose.WriteLine($"> {FormatProcessInfo(_process.StartInfo)}".White());
#endif
using (var reaper = new ProcessReaper(_process))
Expand Down
4 changes: 2 additions & 2 deletions src/Cli/Microsoft.DotNet.Cli.Utils/DebugHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public static void HandleDebugSwitch(ref string[] args)
{
if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
{
args = args.Skip(1).ToArray();
WaitForDebugger();
args = args.Skip(1).ToArray();
WaitForDebugger();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Cli/Microsoft.DotNet.Cli.Utils/EnvironmentProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public IEnumerable<string> ExecutableExtensions
? Environment.GetEnvironmentVariable("PATHEXT")
.Split(';')
.Select(e => e.ToLower().Trim('"'))
: new [] { string.Empty };
: new[] { string.Empty };
}

return _executableExtensions;
Expand Down
8 changes: 4 additions & 4 deletions src/Cli/Microsoft.DotNet.Cli.Utils/ExceptionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ namespace Microsoft.DotNet.Cli.Utils
{
internal static class ExceptionExtensions
{
public static TException DisplayAsError<TException>(this TException exception)
where TException : Exception
public static TException DisplayAsError<TException>(this TException exception)
where TException : Exception
{
exception.Data.Add(CLI_User_Displayed_Exception, true);
return exception;
exception.Data.Add(CLI_User_Displayed_Exception, true);
return exception;
}

public static void ReportAsWarning(this Exception e)
Expand Down
2 changes: 1 addition & 1 deletion src/Cli/Microsoft.DotNet.Cli.Utils/ExponentialRetry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static async Task<T> ExecuteWithRetryOnFailure<T>(Func<Task<T>> action,
int maxRetryCount = 3,
Func<IEnumerable<Task>> timer = null)
{
timer = timer == null ? () => ExponentialRetry.Timer(ExponentialRetry.Intervals): timer;
timer = timer == null ? () => ExponentialRetry.Timer(ExponentialRetry.Intervals) : timer;
return await ExecuteAsyncWithRetry(action, result => result != null && !result.Equals(default), maxRetryCount, timer);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public static class CollectionsExtensions
{
public static IEnumerable<T> OrEmptyIfNull<T>(this IEnumerable<T> enumerable)
{
return enumerable == null
return enumerable == null
? Enumerable.Empty<T>()
: enumerable;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static class LockFileFormatExtensions
public static async Task<LockFile> ReadWithLock(this LockFileFormat subject, string path)
{
return await ConcurrencyUtilities.ExecuteWithFileLockedAsync(
path,
path,
lockedToken =>
{
if (!File.Exists(path))
Expand All @@ -21,10 +21,10 @@ public static async Task<LockFile> ReadWithLock(this LockFileFormat subject, str
string.Format(LocalizableStrings.FileNotFound, path),
LocalizableStrings.ProjectNotRestoredOrRestoreFailed));
}

var lockFile = FileAccessRetrier.RetryOnFileAccessFailure(() => subject.Read(path), LocalizableStrings.CouldNotAccessAssetsFile);

return lockFile;
return lockFile;
},
CancellationToken.None);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ private string GetHostExeName()
}
}

#endif
#endif
Loading

0 comments on commit f65053d

Please sign in to comment.