set WarningsAsErrors = true

This commit is contained in:
John Andrews
2024-05-07 14:05:03 +12:00
parent d6c2034d8e
commit d60b0486b6
81 changed files with 732 additions and 946 deletions
+2
View File
@@ -117,12 +117,14 @@ File shrunk in size by: {{ difference | file_size }} / {{ percent }}%
httpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", settings.ApiToken);
// Create the request content
#pragma warning disable IL2026
var content = new StringContent(JsonSerializer.Serialize(
new {
type = "note",
title,
body
}), Encoding.UTF8, "application/json");
#pragma warning restore IL2026
var response = httpClient.PostAsync("https://api.pushbullet.com/v2/pushes", content).Result;
+1
View File
@@ -13,6 +13,7 @@
<Product>Pushbullet</Product>
<PackageProjectUrl>https://fileflows.com/</PackageProjectUrl>
<Description>Lets you send Pushbullet messages to a server</Description>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<None Update="i18n\*.json">
+1 -1
View File
@@ -11,7 +11,7 @@ public class PushbulletTests
[TestMethod]
public void Pushbullet_Basic_Message()
{
var args = new NodeParameters("test.file", new TestLogger(), false, string.Empty, null);
var args = new NodeParameters("test.file", new TestLogger(), false, string.Empty, null!);
args.GetPluginSettingsJson = (string input) =>
{
return File.ReadAllText("../../../../../Pushbullet.json");
+2
View File
@@ -24,11 +24,13 @@ internal class TestLogger : ILogger
{
if (args == null || args.Length == 0)
return;
#pragma warning disable IL2026
string message = type + " -> " +
string.Join(", ", args.Select(x =>
x == null ? "null" :
x.GetType().IsPrimitive || x is string ? x.ToString() :
System.Text.Json.JsonSerializer.Serialize(x)));
#pragma warning restore IL2026
Messages.Add(message);
}