Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianStehle committed Jan 30, 2024
1 parent 91c6180 commit 4ab601a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions assets/Squidex.Assets.S3/AmazonS3AssetStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public sealed class AmazonS3AssetStore : IAssetStore, IInitializable
private const int BufferSize = 81920;
private readonly AmazonS3AssetOptions options;
private TransferUtility s3Transfer;
private IAmazonS3 s3Client;
private AmazonS3Client s3Client;
private bool canCopy = true;

public AmazonS3AssetStore(IOptions<AmazonS3AssetOptions> options)
Expand Down Expand Up @@ -158,7 +158,7 @@ private async Task CopyViaDownloadAsync(string sourceFileName, string targetFile
BucketName = options.Bucket,
Key = keyTarget,
DisablePayloadSigning = options.DisablePayloadSigning,
DisableMD5Stream = false,
DisableDefaultChecksumValidation = false,
InputStream = teamStream
};

Expand Down Expand Up @@ -255,7 +255,7 @@ public async Task<long> UploadAsync(string fileName, Stream stream, bool overwri
BucketName = options.Bucket,
Key = key,
DisablePayloadSigning = options.DisablePayloadSigning,
DisableMD5Stream = false
DisableDefaultChecksumValidation = false
};

if (stream.GetLengthOrZero() <= 0)
Expand Down
12 changes: 7 additions & 5 deletions assets/Squidex.Assets.Tests/AssetStoreTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
using System.IO.Compression;
using Xunit;

#pragma warning disable RECS0108 // Warns about static fields in generic types

namespace Squidex.Assets;

public abstract class AssetStoreTests<T> where T : IAssetStore
Expand Down Expand Up @@ -41,12 +43,12 @@ public enum TestCase
FolderLinux
}

public static IEnumerable<object[]> FolderCases()
public static readonly TheoryData<TestCase> FolderCases = new TheoryData<TestCase>
{
yield return new object[] { TestCase.NoFolder };
yield return new object[] { TestCase.FolderWindows };
yield return new object[] { TestCase.FolderLinux };
}
TestCase.NoFolder,
TestCase.FolderWindows,
TestCase.FolderLinux
};

[Theory]
[InlineData("../{file}.png")]
Expand Down
2 changes: 1 addition & 1 deletion log/Squidex.Log/Internal/ConsoleLogProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public sealed class ConsoleLogProcessor : IDisposable

public ConsoleLogProcessor()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
if (OperatingSystem.IsWindows())
{
console = new WindowsLogConsole(true);
}
Expand Down
2 changes: 1 addition & 1 deletion text/Squidex.Text/ChatBots/OpenAI/OpenAIChatBotService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public async Task<ChatBotResult> AskQuestionAsync(string prompt,

return new ChatBotResult
{
Choices = response.Choices.Select(x => x.Message.Content).ToList(),
Choices = response.Choices.Select(x => x.Message.Content).Where(x => x != null).ToList()!,
EstimatedCostsInEUR =
(numTokensInput * options.PricePerInputTokenInEUR) +
(numTokensOutput * options.PricePerOutputTokenInEUR)
Expand Down
2 changes: 0 additions & 2 deletions text/Squidex.Text/SvgExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

using HtmlPerformanceKit;
using Squidex.Text.Svg;
using System.Security.Principal;

namespace Squidex.Text;

Expand Down Expand Up @@ -55,7 +54,6 @@ public static SvgMetadata GetSvgMetadata(this string html)
else if (string.Equals(attributeName, "viewBox", StringComparison.OrdinalIgnoreCase))
{
viewBox = attributeValue.Trim();

}
}
}
Expand Down
4 changes: 2 additions & 2 deletions text/Squidex.Text/SvgMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// All rights reserved. Licensed under the MIT license.
// ==========================================================================

namespace Squidex.Text;

#pragma warning disable SA1313 // Parameter names should begin with lower-case letter

namespace Squidex.Text;

public record struct SvgMetadata(string Width, string Height, string ViewBox);

0 comments on commit 4ab601a

Please sign in to comment.