Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings reported when compiling the test runner #83

Open
tmds opened this issue Sep 20, 2023 · 1 comment
Open

Fix warnings reported when compiling the test runner #83

tmds opened this issue Sep 20, 2023 · 1 comment

Comments

@tmds
Copy link
Member

tmds commented Sep 20, 2023

There's a bunch of warnings reported by the compiler. It would be nice if we address them.

dotnet-bunny/Turkey/DotNet.cs(162,30): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/Cleaner.cs(39,27): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/Cleaner.cs(56,27): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/NuGet.cs(28,33): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/NuGet.cs(38,35): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/ProcessExtensions.cs(50,47): warning CS0168: The variable 'ex' is declared but never used [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestOutputFormat.cs(81,40): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestOutputFormat.cs(94,40): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestOutputFormat.cs(16,40): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestOutputFormat.cs(22,40): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestOutputFormat.cs(51,40): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestRunner.cs(47,35): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestRunner.cs(48,35): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestRunner.cs(49,35): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestRunner.cs(50,35): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestRunner.cs(51,35): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestParser.cs(18,54): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestOutputFormat.cs(14,22): warning CA1034: Do not nest type NewOutput. Alternatively, change its accessibility so that it is not externally visible. (https://msdn.microsoft.com/en-us/library/ms182162.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestOutputFormat.cs(12,18): warning CA1052: Type 'TestOutputFormats' is a static holder type but is neither static nor NotInheritable (http://msdn.microsoft.com/library/ms182168.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestOutputFormat.cs(57,22): warning CA1034: Do not nest type JUnitOutput. Alternatively, change its accessibility so that it is not externally visible. (https://msdn.microsoft.com/en-us/library/ms182162.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/Program.cs(15,18): warning CA1052: Type 'Program' is a static holder type but is neither static nor NotInheritable (http://msdn.microsoft.com/library/ms182168.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/Test.cs(21,29): warning CA2227: Change 'IgnoredRIDs' to be read-only by removing the property setter. (https://msdn.microsoft.com/library/ms182327.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/Test.cs(22,29): warning CA2227: Change 'SkipWhen' to be read-only by removing the property setter. (https://msdn.microsoft.com/library/ms182327.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestRunner.cs(25,52): warning CA1051: Do not declare visible instance fields (https://msdn.microsoft.com/en-us/library/ms182141.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/XUnitTest.cs(19,37): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/XUnitTest.cs(20,37): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/BashTest.cs(41,34): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/CsprojCompatibilityPatcher.cs(13,23): warning CA1822: Member Patch does not access instance data and can be marked as static (Shared in VisualBasic) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/Cleaner.cs(39,27): warning CA1822: Member CleanProjectLocalDotNetCruftAsync does not access instance data and can be marked as static (Shared in VisualBasic) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/Cleaner.cs(85,17): warning CA1307: The behavior of 'string.StartsWith(string)' could vary based on the current user's locale settings. Replace this call in 'Turkey.Cleaner.ExpandPath(string)' with a call to 'string.StartsWith(string, System.StringComparison)'. (https://msdn.microsoft.com/en-us/library/bb386080.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/Cleaner.cs(83,36): warning CA1822: Member ExpandPath does not access instance data and can be marked as static (Shared in VisualBasic) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/DotNet.cs(46,40): warning CA1307: The behavior of 'string.StartsWith(string)' could vary based on the current user's locale settings. Replace this call in 'Turkey.DotNet.RuntimeVersions.get' with a call to 'string.StartsWith(string, System.StringComparison)'. (https://msdn.microsoft.com/en-us/library/bb386080.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/DotNet.cs(140,26): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/IEnumerableExtensions.cs(13,23): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/NuGet.cs(24,32): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/NuGet.cs(25,26): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/PlatformId.cs(21,27): warning CA1308: In method 'ComputePlatformIds', replace the call to 'ToLowerInvariant' with 'ToUpperInvariant'. (https://msdn.microsoft.com/en-us/library/bb386042.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/PlatformId.cs(66,24): warning CA1822: Member GetValue does not access instance data and can be marked as static (Shared in VisualBasic) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/PlatformId.cs(76,17): warning CA1307: The behavior of 'string.StartsWith(string)' could vary based on the current user's locale settings. Replace this call in 'Turkey.PlatformId.Unquote(string)' with a call to 'string.StartsWith(string, System.StringComparison)'. (https://msdn.microsoft.com/en-us/library/bb386080.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/PlatformId.cs(76,42): warning CA1307: The behavior of 'string.EndsWith(string)' could vary based on the current user's locale settings. Replace this call in 'Turkey.PlatformId.Unquote(string)' with a call to 'string.EndsWith(string, System.StringComparison)'. (https://msdn.microsoft.com/en-us/library/bb386080.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/PlatformId.cs(71,24): warning CA1822: Member Unquote does not access instance data and can be marked as static (Shared in VisualBasic) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/PlatformId.cs(84,25): warning CA1822: Member GetLddVersion does not access instance data and can be marked as static (Shared in VisualBasic) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/ProcessExtensions.cs(15,19): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/NuGet.cs(31,40): warning CA1307: The behavior of 'Newtonsoft.Json.Linq.JObject.GetValue(string?)' could vary based on the current user's locale settings. Replace this call in 'Turkey.NuGet.IsPackageLiveAsync(string, Turkey.Version, string)' with a call to 'Newtonsoft.Json.Linq.JObject.GetValue(string?, System.StringComparison)'. (https://msdn.microsoft.com/en-us/library/bb386080.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/NuGet.cs(33,29): warning CA1307: The behavior of 'string.Equals(string?)' could vary based on the current user's locale settings. Replace this call in 'Turkey.NuGet.IsPackageLiveAsync(string, Turkey.Version, string)' with a call to 'string.Equals(string?, System.StringComparison)'. (https://msdn.microsoft.com/en-us/library/bb386080.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/NuGet.cs(28,33): warning CA1822: Member IsPackageLiveAsync does not access instance data and can be marked as static (Shared in VisualBasic) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/NuGet.cs(24,32): warning CA2234: Modify 'NuGet.IsPackageLiveAsync(string, Version)' to call 'HttpClient.GetStringAsync(Uri)' instead of 'HttpClient.GetStringAsync(string)'. (https://msdn.microsoft.com/en-us/library/ms182360.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/SourceBuild.cs(19,23): warning CA1055: Change the return type of method SourceBuild.GetBranchContentUrl(Version) from string to System.Uri. (https://msdn.microsoft.com/en-us/library/ms182176.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/SourceBuild.cs(19,23): warning CA1822: Member GetBranchContentUrl does not access instance data and can be marked as static (Shared in VisualBasic) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/Version.cs(137,13): warning CA1065: GetHashCode creates an exception of type Exception. Exceptions should not be raised in this type of method. If this exception instance might be raised, change this method's logic so it no longer raises an exception. (https://msdn.microsoft.com/en-us/library/bb386039.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/ProcessExtensions.cs(46,23): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/SourceBuild.cs(44,33): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/SourceBuild.cs(46,40): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/SourceBuild.cs(63,37): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/NuGet.cs(41,23): warning CA2208: Call the ArgumentNullException constructor that contains a message and/or paramName parameter. (https://msdn.microsoft.com/en-us/library/ms182347.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/NuGet.cs(69,31): warning CA1307: The behavior of 'string.Replace(string, string?)' could vary based on the current user's locale settings. Replace this call in 'Turkey.NuGet.GenerateNuGetConfig(System.Collections.Generic.List<string>, string)' with a call to 'string.Replace(string, string?, System.StringComparison)'. (https://msdn.microsoft.com/en-us/library/bb386080.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/SourceBuild.cs(63,37): warning CA2234: Modify 'SourceBuild.GetNuGetConfigAsync(Version)' to call 'HttpClient.GetStringAsync(Uri)' instead of 'HttpClient.GetStringAsync(string)'. (https://msdn.microsoft.com/en-us/library/ms182360.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/NuGet.cs(38,35): warning CA1822: Member GenerateNuGetConfig does not access instance data and can be marked as static (Shared in VisualBasic) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/SourceBuild.cs(44,33): warning CA2234: Modify 'SourceBuild.GetProdConFeedAsync(Version)' to call 'HttpClient.GetStringAsync(Uri)' instead of 'HttpClient.GetStringAsync(string)'. (https://msdn.microsoft.com/en-us/library/ms182360.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/SourceBuild.cs(46,40): warning CA2234: Modify 'SourceBuild.GetProdConFeedAsync(Version)' to call 'HttpClient.GetAsync(Uri)' instead of 'HttpClient.GetAsync(string)'. (https://msdn.microsoft.com/en-us/library/ms182360.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/Program.cs(117,40): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/Program.cs(132,33): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/Test.cs(61,23): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/Test.cs(66,36): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestOutputFormat.cs(149,28): warning CA1822: Member RemoveInvalidXmlCharacters does not access instance data and can be marked as static (Shared in VisualBasic) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/Program.cs(156,48): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/Program.cs(176,45): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/Program.cs(192,34): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestOutputFormat.cs(105,58): warning CA1305: The behavior of 'int.ToString()' could vary based on the current user's locale settings. Replace this call in 'TestOutputFormats.JUnitOutput.AfterRunningAllTestsAsync(TestResults)' with a call to 'int.ToString(IFormatProvider)'. (https://msdn.microsoft.com/en-us/library/ms182190.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestOutputFormat.cs(106,61): warning CA1305: The behavior of 'int.ToString()' could vary based on the current user's locale settings. Replace this call in 'TestOutputFormats.JUnitOutput.AfterRunningAllTestsAsync(TestResults)' with a call to 'int.ToString(IFormatProvider)'. (https://msdn.microsoft.com/en-us/library/ms182190.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestOutputFormat.cs(18,32): warning CA1305: The behavior of 'string.Format(string, object)' could vary based on the current user's locale settings. Replace this call in 'TestOutputFormats.NewOutput.AfterParsingTestAsync(string, bool)' with a call to 'string.Format(IFormatProvider, string, params object[])'. (https://msdn.microsoft.com/en-us/library/ms182190.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestRunner.cs(73,19): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/Program.cs(218,27): warning CA1308: In method 'CreateTraits', replace the call to 'ToLowerInvariant' with 'ToUpperInvariant'. (https://msdn.microsoft.com/en-us/library/bb386042.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestRunner.cs(94,23): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestRunner.cs(97,40): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestRunner.cs(106,23): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestRunner.cs(126,27): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestRunner.cs(132,40): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestRunner.cs(150,23): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestRunner.cs(153,19): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/Program.cs(235,31): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/Program.cs(238,30): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestParser.cs(101,22): warning CA1822: Member VersionMatches does not access instance data and can be marked as static (Shared in VisualBasic) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/Program.cs(261,26): warning CA2007: Do not directly await a Task without calling ConfigureAwait [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/TestParser.cs(18,144): warning CA1801: Parameter testConfiguration of method TryParseAsync is never used. Remove the parameter or use it in the method body. (https://msdn.microsoft.com/en-us/library/ms182268.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/Program.cs(199,89): warning CA1801: Parameter sdkVersion of method CreateTraits is never used. Remove the parameter or use it in the method body. (https://msdn.microsoft.com/en-us/library/ms182268.aspx) [dotnet-bunny/Turkey/Turkey.csproj]
dotnet-bunny/Turkey/NuGet.cs(28,59): warning CA1801: Parameter name of method IsPackageLiveAsync is never used. Remove the parameter or use it in the method body. (https://msdn.microsoft.com/en-us/library/ms182268.aspx) [dotnet-bunny/Turkey/Turkey.csproj]

cc @omajid

@omajid
Copy link
Member

omajid commented Sep 3, 2024

First priority is to reduce noise in logs, so disabling the warnings would be good. And fixing the warnings themselves would be even better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants