1111using System . Runtime . InteropServices ;
1212
1313namespace Turkey
14- {
15- public class Program
14+ { public static class Program
15+
1616 {
1717 public static readonly Option < bool > verboseOption = new Option < bool > (
1818 new string [ ] { "--verbose" , "-v" } ,
@@ -118,7 +118,7 @@ public static async Task<int> Run(string testRoot,
118118
119119 Version packageVersion = runtimeVersion ;
120120 string nuGetConfig = await GenerateNuGetConfigIfNeededAsync ( additionalFeed , packageVersion ,
121- useSourceBuildNuGetConfig : false ) ;
121+ useSourceBuildNuGetConfig : false ) . ConfigureAwait ( false ) ;
122122 if ( verbose && nuGetConfig != null )
123123 {
124124 Console . WriteLine ( "Using nuget.config: " ) ;
@@ -132,7 +132,7 @@ public static async Task<int> Run(string testRoot,
132132 verboseOutput : verbose ,
133133 nuGetConfig : nuGetConfig ) ;
134134
135- var results = await runner . ScanAndRunAsync ( testOutputs , logDir . FullName , defaultTimeout ) ;
135+ var results = await runner . ScanAndRunAsync ( testOutputs , logDir . FullName , defaultTimeout ) . ConfigureAwait ( false ) ;
136136
137137 int exitCode = ( results . Failed == 0 ) ? 0 : 1 ;
138138 return exitCode ;
@@ -157,7 +157,7 @@ public static async Task<string> GenerateNuGetConfigIfNeededAsync(string additio
157157 {
158158 try
159159 {
160- nugetConfig = await sourceBuild . GetNuGetConfigAsync ( netCoreAppVersion ) ;
160+ nugetConfig = await sourceBuild . GetNuGetConfigAsync ( netCoreAppVersion ) . ConfigureAwait ( false ) ;
161161 }
162162 catch ( HttpRequestException exception )
163163 {
@@ -173,14 +173,16 @@ public static async Task<string> GenerateNuGetConfigIfNeededAsync(string additio
173173 // if the nugetConfig has a <clear/> element that removes
174174 // it.
175175 urls . Add ( "https://api.nuget.org/v3/index.json" ) ;
176- return await nuget . GenerateNuGetConfig ( urls , nugetConfig ) ;
176+ return await nuget . GenerateNuGetConfig ( urls , nugetConfig ) . ConfigureAwait ( false ) ;
177177 }
178178 }
179179
180180 return null ;
181181 }
182182
183+ #pragma warning disable CA1801 // Remove unused parameter
183184 public static IReadOnlySet < string > CreateTraits ( Version runtimeVersion , Version sdkVersion , List < string > rids , bool isMonoRuntime , IEnumerable < string > additionalTraits )
185+ #pragma warning restore CA1801 // Remove unused parameter
184186 {
185187 var traits = new HashSet < string > ( StringComparer . OrdinalIgnoreCase ) ;
186188
@@ -199,7 +201,9 @@ public static IReadOnlySet<string> CreateTraits(Version runtimeVersion, Version
199201 }
200202
201203 // Add 'arch=' trait.
204+ #pragma warning disable CA1308 // Normalize strings to uppercase
202205 string arch = RuntimeInformation . OSArchitecture . ToString ( ) . ToLowerInvariant ( ) ;
206+ #pragma warning restore CA1308 // Normalize strings to uppercase
203207 traits . Add ( $ "arch={ arch } ") ;
204208
205209 // Add 'runtime=' trait.
@@ -231,7 +235,7 @@ static async Task<int> Main(string[] args)
231235 rootCommand . AddOption ( traitOption ) ;
232236 rootCommand . AddOption ( timeoutOption ) ;
233237
234- return await rootCommand . InvokeAsync ( args ) ;
238+ return await rootCommand . InvokeAsync ( args ) . ConfigureAwait ( false ) ;
235239 }
236240 }
237- }
241+ }
0 commit comments