Skip to content

Commit d78d338

Browse files
author
Ersan Bozduman
committed
more lint fixes
1 parent 4aa85ee commit d78d338

File tree

8 files changed

+1112
-570
lines changed

8 files changed

+1112
-570
lines changed

Minio.Examples/Cases/SelectObjectContent.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@ namespace Minio.Examples.Cases;
2424
internal static class SelectObjectContent
2525
{
2626
// Get object in a bucket
27-
public static async Task Run(IMinioClient minio,
27+
public static async Task Run(
28+
IMinioClient minio,
2829
string bucketName = "my-bucket-name",
29-
string objectName = "my-object-name")
30+
string objectName = "my-object-name"
31+
)
3032
{
31-
if (minio is null) throw new ArgumentNullException(nameof(minio));
33+
if (minio is null)
34+
throw new ArgumentNullException(nameof(minio));
3235

3336
var newObjectName = "new" + objectName;
3437
try
@@ -60,12 +63,12 @@ public static async Task Run(IMinioClient minio,
6063
{
6164
FileHeaderInfo = CSVFileHeaderInfo.None,
6265
RecordDelimiter = "\n",
63-
FieldDelimiter = ","
64-
}
66+
FieldDelimiter = ",",
67+
},
6568
};
6669
var outputSerialization = new SelectObjectOutputSerialization
6770
{
68-
CSV = new CSVOutputOptions { RecordDelimiter = "\n", FieldDelimiter = "," }
71+
CSV = new CSVOutputOptions { RecordDelimiter = "\n", FieldDelimiter = "," },
6972
};
7073
var args = new SelectObjectContentArgs()
7174
.WithBucket(bucketName)
@@ -80,7 +83,8 @@ public static async Task Run(IMinioClient minio,
8083
Console.WriteLine("Bytes scanned:" + resp.Stats.BytesScanned);
8184
Console.WriteLine("Bytes returned:" + resp.Stats.BytesReturned);
8285
Console.WriteLine("Bytes processed:" + resp.Stats.BytesProcessed);
83-
if (resp.Progress is not null) Console.WriteLine("Progress :" + resp.Progress.BytesProcessed);
86+
if (resp.Progress is not null)
87+
Console.WriteLine("Progress :" + resp.Progress.BytesProcessed);
8488
}
8589
catch (Exception e)
8690
{

Minio.Functional.Tests/FunctionalTest.cs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
* MinIO .NET Library for Amazon S3 Compatible Cloud Storage,
33
* (C) 2017-2021 MinIO, Inc.
44
*
@@ -50,7 +50,6 @@ public static class FunctionalTest
5050
{
5151
private const int KB = 1024;
5252
private const int MB = 1024 * 1024;
53-
private const int GB = 1024 * 1024 * 1024;
5453

5554
private const string dataFile1B = "datafile-1-b";
5655

@@ -117,15 +116,6 @@ public static class FunctionalTest
117116
private const string setBucketPolicySignature =
118117
"Task SetPolicyAsync(SetPolicyArgs args, CancellationToken cancellationToken = default(CancellationToken))";
119118

120-
private const string getBucketNotificationSignature =
121-
"Task<BucketNotification> GetBucketNotificationAsync(GetBucketNotificationsArgs args, CancellationToken cancellationToken = default(CancellationToken))";
122-
123-
private const string setBucketNotificationSignature =
124-
"Task SetBucketNotificationAsync(SetBucketNotificationsArgs args, CancellationToken cancellationToken = default(CancellationToken))";
125-
126-
private const string removeAllBucketsNotificationSignature =
127-
"Task RemoveAllBucketNotificationsAsync(RemoveAllBucketNotifications args, CancellationToken cancellationToken = default(CancellationToken))";
128-
129119
private const string setBucketEncryptionSignature =
130120
"Task SetBucketEncryptionAsync(SetBucketEncryptionArgs args, CancellationToken cancellationToken = default(CancellationToken))";
131121

@@ -267,7 +257,7 @@ public static string GetRandomObjectName(int length = 5)
267257
// Server side does not allow the following characters in object names
268258
// '-', '_', '.', '/', '*'
269259
#if NET6_0_OR_GREATER
270-
var characters = "abcd+%$#@&{}[]()";
260+
const string characters = "abcd+%$#@&{}[]()";
271261
#else
272262
var characters = "abcdefgh+%$#@&";
273263
#endif
@@ -281,7 +271,7 @@ public static string GetRandomObjectName(int length = 5)
281271
// Generate a random string
282272
public static string GetRandomName(int length = 5)
283273
{
284-
var characters = "0123456789abcdefghijklmnopqrstuvwxyz";
274+
const string characters = "0123456789abcdefghijklmnopqrstuvwxyz";
285275
if (length > 50)
286276
length = 50;
287277

@@ -300,7 +290,7 @@ internal static void GenerateRandom500MB_File(string fileName)
300290
FileAccess.Write,
301291
FileShare.None,
302292
4096,
303-
true
293+
useAsync: true
304294
);
305295
var fileSize = 500L * 1024 * 1024;
306296
var segments = fileSize / 10000;

Minio.Functional.Tests/Minio.Functional.Tests.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,12 @@
55
<IsPackable>False</IsPackable>
66
<NoWarn>$(NoWarn),IDE1006</NoWarn>
77
</PropertyGroup>
8-
98
<ItemGroup>
109
<PackageReference Include="MSTest.TestFramework" Version="3.8.3" />
1110
<PackageReference Include="SharpZipLib" Version="1.4.2" />
1211
<ProjectReference Include="..\Minio\Minio.csproj" />
1312
</ItemGroup>
14-
1513
<ItemGroup Condition=" $(TargetFramework.StartsWith('net4')) ">
1614
<Reference Include="System.Web" />
1715
</ItemGroup>
18-
19-
</Project>
16+
</Project>

0 commit comments

Comments
 (0)