Skip to content

Commit

Permalink
Add utf8 with bom (actions#2641)
Browse files Browse the repository at this point in the history
* Change default file encoding
  • Loading branch information
JoannaaKL authored Jun 2, 2023
1 parent 3a1376f commit efffbae
Show file tree
Hide file tree
Showing 268 changed files with 475 additions and 486 deletions.
9 changes: 0 additions & 9 deletions .editorconfig

This file was deleted.

2 changes: 1 addition & 1 deletion src/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[*.cs]
charset = utf-8
charset = utf-8-bom
insert_final_newline = true

csharp_new_line_before_else = true
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/ActionCommand.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GitHub.Runner.Sdk;
using GitHub.Runner.Sdk;
using System;
using System.Collections.Generic;

Expand Down
4 changes: 2 additions & 2 deletions src/Runner.Common/ActionResult.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GitHub.Runner.Common
namespace GitHub.Runner.Common
{
public enum ActionResult
{
Expand All @@ -10,4 +10,4 @@ public enum ActionResult

Skipped = 3
}
}
}
2 changes: 1 addition & 1 deletion src/Runner.Common/BrokerServer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/CommandLineParser.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using GitHub.DistributedTask.Logging;
using GitHub.Runner.Sdk;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/ConfigurationStore.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GitHub.Runner.Sdk;
using GitHub.Runner.Sdk;
using System;
using System.IO;
using System.Linq;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/Constants.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;

namespace GitHub.Runner.Common
{
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/ExtensionManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GitHub.Runner.Sdk;
using GitHub.Runner.Sdk;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/HostContext.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/HostTraceListener.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GitHub.Runner.Sdk;
using GitHub.Runner.Sdk;
using System;
using System.Diagnostics;
using System.Globalization;
Expand Down
4 changes: 2 additions & 2 deletions src/Runner.Common/HttpClientHandlerFactory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Net.Http;
using GitHub.Runner.Sdk;

Expand All @@ -24,4 +24,4 @@ public HttpClientHandler CreateClientHandler(RunnerWebProxy webProxy)
return client;
}
}
}
}
8 changes: 4 additions & 4 deletions src/Runner.Common/JobNotification.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
Expand Down Expand Up @@ -37,10 +37,10 @@ public void StartClient(string monitorSocketAddress)
{
ConnectMonitor(monitorSocketAddress);
}

private void StartMonitor(Guid jobId, string accessToken, Uri serverUri)
{
if(String.IsNullOrEmpty(accessToken))
if (String.IsNullOrEmpty(accessToken))
{
Trace.Info("No access token could be retrieved to start the monitor.");
return;
Expand Down Expand Up @@ -82,7 +82,7 @@ private async Task EndMonitor()
_monitorSocket.Send(Encoding.UTF8.GetBytes(message));
Trace.Info("Finished EndMonitor writing to socket");

await Task.Delay(TimeSpan.FromSeconds(2));
await Task.Delay(TimeSpan.FromSeconds(2));
}
}
catch (SocketException e)
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/JobServer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/JobServerQueue.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/JobStatusEventArgs.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using GitHub.DistributedTask.WebApi;

namespace GitHub.Runner.Common
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/LaunchServer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/Logging.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.IO;

namespace GitHub.Runner.Common
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/ProcessInvoker.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GitHub.Runner.Common.Util;
using GitHub.Runner.Common.Util;
using GitHub.Runner.Sdk;
using System;
using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/ResultsServer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Headers;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/RunServer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/RunnerDotcomServer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GitHub.DistributedTask.WebApi;
using GitHub.DistributedTask.WebApi;
using System;
using System.Collections.Generic;
using System.Threading;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/RunnerServer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GitHub.DistributedTask.WebApi;
using GitHub.DistributedTask.WebApi;
using System;
using System.Collections.Generic;
using System.Threading;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/RunnerService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading;
using System.Threading.Tasks;
using GitHub.Runner.Sdk;
Expand Down
4 changes: 2 additions & 2 deletions src/Runner.Common/StdoutTraceListener.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
Expand Down Expand Up @@ -93,4 +93,4 @@ private void WriteFooter(TraceEventCache eventCache)
IndentLevel--;
}
}
}
}
2 changes: 1 addition & 1 deletion src/Runner.Common/ThrottlingReportHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/TraceManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Concurrent;
using System.Diagnostics;
using GitHub.DistributedTask.Logging;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/Tracing.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using Newtonsoft.Json;
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
Expand Down
4 changes: 2 additions & 2 deletions src/Runner.Common/Unit.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Represents absence of value.
// Represents absence of value.
namespace GitHub.Runner.Common
{
public readonly struct Unit
{
public static readonly Unit Value = default;
}
}
}
2 changes: 1 addition & 1 deletion src/Runner.Common/Util/EncodingUtil.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading;
using System.Threading.Tasks;
using GitHub.Runner.Sdk;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/Util/EnumUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

public static class EnumUtil
{
public static T? TryParse<T>(string value) where T: struct
public static T? TryParse<T>(string value) where T : struct
{
T val;
if (Enum.TryParse(value ?? string.Empty, ignoreCase: true, result: out val))
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/Util/MessageUtil.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GitHub.Runner.Common.Util
namespace GitHub.Runner.Common.Util
{
using System;
using GitHub.DistributedTask.WebApi;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/Util/VarUtil.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;

namespace GitHub.Runner.Common.Util
{
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Listener/BrokerMessageListener.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
Expand Down
4 changes: 2 additions & 2 deletions src/Runner.Listener/Checks/ActionsCheck.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
Expand Down Expand Up @@ -90,4 +90,4 @@ public async Task<bool> RunCheck(string url, string pat)
return result;
}
}
}
}
4 changes: 2 additions & 2 deletions src/Runner.Listener/Checks/CheckUtil.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics.Tracing;
using System.IO;
Expand Down Expand Up @@ -415,4 +415,4 @@ protected override void OnEventWritten(EventWrittenEventArgs eventData)
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/Runner.Listener/Checks/GitCheck.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand Down
4 changes: 2 additions & 2 deletions src/Runner.Listener/Checks/ICheckExtension.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Threading.Tasks;
using GitHub.Runner.Common;

Expand Down Expand Up @@ -27,4 +27,4 @@ public CheckResult()

public List<string> Logs { get; set; }
}
}
}
4 changes: 2 additions & 2 deletions src/Runner.Listener/Checks/InternetCheck.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
Expand Down Expand Up @@ -56,4 +56,4 @@ public async Task<bool> RunCheck(string url, string pat)
return result;
}
}
}
}
2 changes: 1 addition & 1 deletion src/Runner.Listener/Checks/NodeJsCheck.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Listener/CommandSettings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GitHub.Runner.Listener.Configuration;
using GitHub.Runner.Listener.Configuration;
using GitHub.Runner.Common.Util;
using System;
using System.Collections;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Listener/Configuration/ConfigurationManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Listener/Configuration/CredentialManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using GitHub.Runner.Common;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if OS_WINDOWS
#if OS_WINDOWS
#pragma warning disable CA1416
using System;
using System.Collections;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Listener/Configuration/PromptManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GitHub.Runner.Common;
using GitHub.Runner.Common;
using GitHub.Runner.Sdk;
using System;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if OS_WINDOWS
#if OS_WINDOWS
using System.IO;
using System.Security.Cryptography;
using System.Text;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Listener/Configuration/RSAFileKeyManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if OS_LINUX || OS_OSX
#if OS_LINUX || OS_OSX
using System;
using System.IO;
using System.Security.Cryptography;
Expand Down
14 changes: 7 additions & 7 deletions src/Runner.Listener/Configuration/ServiceControlManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Text.RegularExpressions;
using GitHub.Runner.Common;
Expand Down Expand Up @@ -68,20 +68,20 @@ public void CalculateServiceName(RunnerSettings settings, string serviceNamePatt
// Lets add a suffix with a random number to reduce the chance of collisions between runner names once we truncate
var random = new Random();
var num = random.Next(1000, 9999).ToString();
runnerNameSubstring +=$"-{num}";
runnerNameSubstring += $"-{num}";
serviceName = StringUtil.Format(serviceNamePattern, repoOrOrgNameSubstring, runnerNameSubstring);
}

serviceDisplayName = StringUtil.Format(serviceDisplayNamePattern, repoOrOrgName, settings.AgentName);

Trace.Info($"Service name '{serviceName}' display name '{serviceDisplayName}' will be used for service configuration.");
}
#if (OS_LINUX || OS_OSX)
const int MaxServiceNameLength = 150;
const int MaxRepoOrgCharacters = 70;
#elif OS_WINDOWS
#if (OS_LINUX || OS_OSX)
const int MaxServiceNameLength = 150;
const int MaxRepoOrgCharacters = 70;
#elif OS_WINDOWS
const int MaxServiceNameLength = 80;
const int MaxRepoOrgCharacters = 45;
#endif
#endif
}
}
Loading

0 comments on commit efffbae

Please sign in to comment.