Skip to content

Commit 591f862

Browse files
Code formating
1 parent 0652eb5 commit 591f862

File tree

276 files changed

+706
-465
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

276 files changed

+706
-465
lines changed

Build/Program.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@
4646
packageId,
4747
Path.Combine(outputDir, "CSharpInteractive", $"{packageId}.{packageVersion.ToString()}.nupkg"),
4848
true),
49-
49+
5050
new PackageInfo(
5151
toolPackageId,
5252
Path.Combine(outputDir, "CSharpInteractive.Tool", $"{toolPackageId}.{packageVersion.ToString()}.nupkg"),
5353
true),
54-
54+
5555
new PackageInfo(
5656
templatesPackageId,
5757
Path.Combine(templateOutputDir, $"{templatesPackageId}.{packageVersion.ToString()}.nupkg"),
@@ -74,7 +74,7 @@
7474
{
7575
Directory.Delete(nuGetPackagePath, true);
7676
}
77-
77+
7878
var packageOutput = Path.GetDirectoryName(package.Package);
7979
if (Directory.Exists(packageOutput))
8080
{
@@ -153,7 +153,7 @@
153153
var dotCoverReportXml = Path.Combine(reportDir, "dotCover.xml");
154154
new DotNetCustom("dotCover", "report", $"--source={dotCoverSnapshot}", $"--output={dotCoverReportXml}", "--reportType=TeamCityXml").WithShortName("Generating the code coverage reports")
155155
.Run().EnsureSuccess();
156-
156+
157157
if (TryGetCoverage(dotCoverReportXml, out coveragePercentage))
158158
{
159159
switch (coveragePercentage)
@@ -176,7 +176,7 @@
176176
var uninstallTool = new DotNetCustom("tool", "uninstall", toolPackageId, "-g")
177177
.WithShortName("Uninstalling tool");
178178

179-
if (uninstallTool.Run(_ => { } ).ExitCode != 0)
179+
if (uninstallTool.Run(_ => { }).ExitCode != 0)
180180
{
181181
Warning($"{uninstallTool} failed.");
182182
}
@@ -271,20 +271,20 @@ async Task CheckCompatibilityAsync(
271271
.WithWorkingDirectory(buildProjectDir)
272272
.WithShortName($"Creating a new {sampleProjectName}")
273273
.RunAsync().EnsureSuccess();
274-
274+
275275
await new DotNetBuild()
276276
.WithProject(buildProjectDir)
277277
.WithSources(nuGetSource, Path.Combine(output, "CSharpInteractive"))
278278
.WithShortName($"Building the {sampleProjectName}")
279279
.BuildAsync().EnsureSuccess();
280-
280+
281281
await new DotNetRun()
282282
.WithProject(buildProjectDir)
283283
.WithNoBuild(true)
284284
.WithWorkingDirectory(sampleProjectDir)
285285
.WithShortName($"Running a build for the {sampleProjectName}")
286286
.RunAsync().EnsureSuccess();
287-
287+
288288
await new DotNetCustom("csi", Path.Combine(buildProjectDir, "Program.csx"))
289289
.WithWorkingDirectory(sampleProjectDir)
290290
.WithShortName($"Running a build as a C# script for the {sampleProjectName}")

Build/Tools.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
internal static class Tools
88
{
9-
public static bool CI =>
9+
public static bool CI =>
1010
Environment.GetEnvironmentVariable("TEAMCITY_VERSION") is not null
1111
|| Environment.GetEnvironmentVariable("CI") == "true";
12-
12+
1313
public static NuGetVersion GetNextNuGetVersion(NuGetRestoreSettings settings, NuGetVersion defaultVersion)
1414
{
1515
var floatRange = defaultVersion.Release != string.Empty
@@ -33,7 +33,7 @@ private static string GetNextRelease(SemanticVersion curVersion, string release)
3333
return release;
3434
}
3535

36-
return int.TryParse(string.Concat(curVersion.Release.Where(char.IsNumber)), out var num)
36+
return int.TryParse(string.Concat(curVersion.Release.Where(char.IsNumber)), out var num)
3737
? $"{string.Concat(curVersion.Release.Where(i => !char.IsNumber(i)))}{num + 1}"
3838
: release;
3939
}
@@ -58,7 +58,7 @@ public static string GetProperty(string name, string defaultProp, bool showWarni
5858

5959
return defaultProp;
6060
}
61-
61+
6262
public static bool TryGetCoverage(string dotCoverReportXml, out int coveragePercentage)
6363
{
6464
var dotCoverReportDoc = new XmlDocument();
@@ -79,7 +79,7 @@ public static bool HasLinuxDocker()
7979
hasLinuxDocker = true;
8080
}
8181
});
82-
82+
8383
return hasLinuxDocker;
8484
}
8585
}

CSharpInteractive.HostApi/BuildMessage.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// ReSharper disable InconsistentNaming
22
// ReSharper disable NotAccessedPositionalProperty.Global
33
// ReSharper disable InconsistentNaming
4+
45
namespace HostApi;
56

67
using JetBrains.TeamCity.ServiceMessages;
@@ -45,18 +46,18 @@ public record BuildMessage(
4546
/// <summary>
4647
/// Contains the result of test execution when <see cref="State"/> is set to <see cref="BuildMessageState.TestResult"/>.
4748
/// </summary>
48-
public TestResult? TestResult =>
49+
public TestResult? TestResult =>
4950
ServiceMessage != null && TryGetTestState(ServiceMessage.Name, out var testState)
5051
? CreateResult(CreateKey(ServiceMessage), ServiceMessage, testState)
5152
: default(TestResult?);
5253

5354
/// <inheritdoc />
5455
public override string ToString() => Text;
55-
56+
5657
internal static TestResult CreateResult(TestKey key, IServiceMessage message, TestState state)
5758
{
5859
var testSource = message.GetValue("testSource") ?? string.Empty;
59-
var displayName = message.GetValue("displayName") ?? string.Empty;
60+
var displayName = message.GetValue("displayName") ?? string.Empty;
6061
var resultDisplayName = message.GetValue("resultDisplayName") ?? string.Empty;
6162
var codeFilePath = message.GetValue("codeFilePath") ?? string.Empty;
6263
var fullyQualifiedName = message.GetValue("fullyQualifiedName") ?? string.Empty;
@@ -69,7 +70,7 @@ internal static TestResult CreateResult(TestKey key, IServiceMessage message, Te
6970
.WithResultDisplayName(resultDisplayName)
7071
.WithCodeFilePath(codeFilePath)
7172
.WithFullyQualifiedName(fullyQualifiedName);
72-
73+
7374
if (Guid.TryParse(message.GetValue("id"), out var id))
7475
{
7576
result = result.WithId(id);
@@ -84,30 +85,30 @@ internal static TestResult CreateResult(TestKey key, IServiceMessage message, Te
8485
{
8586
result = result.WithLineNumber(lineNumber);
8687
}
87-
88+
8889
return result;
8990
}
9091

9192
internal static TestKey CreateKey(IServiceMessage message)
9293
{
9394
var flowId = message.GetValue("flowId") ?? string.Empty;
94-
var suiteName = message.GetValue("suiteName") ?? string.Empty;
95+
var suiteName = message.GetValue("suiteName") ?? string.Empty;
9596
var name = message.GetValue("name") ?? string.Empty;
9697
return new TestKey(flowId, suiteName, name);
9798
}
9899

99100
private static bool TryGetTestState(string? name, out TestState state)
100101
{
101-
switch(name?.ToLowerInvariant())
102+
switch (name?.ToLowerInvariant())
102103
{
103104
case "testfinished":
104105
state = TestState.Finished;
105106
return true;
106-
107+
107108
case "testignored":
108109
state = TestState.Ignored;
109110
return true;
110-
111+
111112
case "testfailed":
112113
state = TestState.Failed;
113114
return true;
@@ -116,7 +117,7 @@ private static bool TryGetTestState(string? name, out TestState state)
116117
state = default;
117118
return false;
118119
}
119-
120+
120121
// ReSharper disable once NotAccessedPositionalProperty.Local
121122
internal readonly record struct TestKey(string FlowId, string SuiteName, string TestName);
122123
}

CSharpInteractive.HostApi/BuildMessageState.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// ReSharper disable InconsistentNaming
22
// ReSharper disable UnusedMember.Global
3+
34
namespace HostApi;
45

56
/// <summary>
@@ -21,17 +22,17 @@ public enum BuildMessageState
2122
/// Build warning.
2223
/// </summary>
2324
Warning,
24-
25+
2526
/// <summary>
2627
/// The message that the string was sent to stdErr.
2728
/// </summary>
2829
StdError,
29-
30+
3031
/// <summary>
3132
/// Build error.
3233
/// </summary>
3334
Failure,
34-
35+
3536
/// <summary>
3637
/// Build problem.
3738
/// </summary>

CSharpInteractive.HostApi/BuildStatistics.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public override string ToString()
5151
{
5252
sb.Append(" and ");
5353
}
54-
54+
5555
sb.Append(Tests);
5656
sb.Append(" finished ");
5757
sb.Append(GetName("test", Tests));
@@ -76,7 +76,7 @@ private static void AddValue(StringBuilder sb, string name, int value, int initi
7676
{
7777
sb.Append(", ");
7878
}
79-
79+
8080
sb.Append(value);
8181
sb.Append(' ');
8282
sb.Append(name);

CSharpInteractive.HostApi/Color.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ public enum Color
1515
/// Standard text output color.
1616
/// </summary>
1717
Default,
18-
18+
1919
/// <summary>
2020
/// The color of the header output.
2121
/// </summary>
2222
Header,
23-
23+
2424
/// <summary>
2525
/// Color of trace messages.
2626
/// </summary>
2727
Trace,
28-
28+
2929
/// <summary>
3030
/// Color of the success messages.
3131
/// </summary>
@@ -35,12 +35,12 @@ public enum Color
3535
/// Color of messages containing warnings.
3636
/// </summary>
3737
Warning,
38-
38+
3939
/// <summary>
4040
/// Color of messages containing errors.
4141
/// </summary>
4242
Error,
43-
43+
4444
/// <summary>
4545
/// Colour for details.
4646
/// </summary>

CSharpInteractive.HostApi/CommandLine.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// ReSharper disable UnusedMember.Global
22
// ReSharper disable MemberCanBeProtected.Global
33
// ReSharper disable ReturnTypeCanBeEnumerable.Global
4+
45
namespace HostApi;
56

67
using System.Diagnostics;
@@ -50,7 +51,7 @@ internal CommandLine(IStartInfo startInfo)
5051
{ }
5152

5253
/// <inheritdoc/>
53-
public string ShortName =>
54+
public string ShortName =>
5455
!string.IsNullOrWhiteSpace(_shortName)
5556
? _shortName
5657
: Path.GetFileNameWithoutExtension(ExecutablePath);
@@ -82,7 +83,7 @@ public override string ToString()
8283
return sb.ToString();
8384
}
8485

85-
private static string Escape(string text) =>
86+
private static string Escape(string text) =>
8687
!text.TrimStart().StartsWith("\"") && text.Contains(' ')
8788
? $"\"{text}\""
8889
: text;

CSharpInteractive.HostApi/CommandLineTools.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public static class CommandLineTools
1919
/// <returns>Created command line.</returns>
2020
public static CommandLine AsCommandLine(this string executable, params string[] args) =>
2121
new(executable, args);
22-
22+
2323
/// <summary>
2424
/// Customizes a command line by overriding its parameters as command line arguments and others.
2525
/// <example>
@@ -41,7 +41,7 @@ public static CommandLine AsCommandLine(this string executable, params string[]
4141
/// <param name="baseCommandLine">The base command for customization.</param>
4242
/// <param name="customizer">Customization function.</param>
4343
/// <returns>Customized command line.</returns>
44-
public static ICommandLine Customize(this ICommandLine baseCommandLine, Func<CommandLine, ICommandLine> customizer) =>
44+
public static ICommandLine Customize(this ICommandLine baseCommandLine, Func<CommandLine, ICommandLine> customizer) =>
4545
new CustomCommandLine(baseCommandLine, customizer);
4646

4747
private class CustomCommandLine(ICommandLine baseCommandLine, Func<CommandLine, ICommandLine> customizer) : ICommandLine

0 commit comments

Comments
 (0)