Skip to content

Commit 4aa85ee

Browse files
author
Ersan Bozduman
committed
Yet more lint changes
1 parent 5f1c0a0 commit 4aa85ee

File tree

8 files changed

+33
-28
lines changed

8 files changed

+33
-28
lines changed

Minio.Examples/Cases/SelectObjectContent.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ public static async Task Run(IMinioClient minio,
5858
CompressionType = SelectCompressionType.NONE,
5959
CSV = new CSVInputOptions
6060
{
61-
FileHeaderInfo = CSVFileHeaderInfo.None, RecordDelimiter = "\n", FieldDelimiter = ","
61+
FileHeaderInfo = CSVFileHeaderInfo.None,
62+
RecordDelimiter = "\n",
63+
FieldDelimiter = ","
6264
}
6365
};
6466
var outputSerialization = new SelectObjectOutputSerialization

Minio.Functional.Tests/FunctionalTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@ internal static async Task RemoveObjects_Test3(IMinioClient minio)
15461546
var tasks = new Task[count * 2];
15471547
var objectsList = new List<string>();
15481548
await Setup_WithLock_Test(minio, bucketName).ConfigureAwait(false);
1549-
for (var i = 0; i < count * 2; )
1549+
for (var i = 0; i < count * 2;)
15501550
{
15511551
tasks[i++] = PutObject_Task(
15521552
minio,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<TargetFrameworks>net8.0</TargetFrameworks>
44
<OutputType>Exe</OutputType>
55
<IsPackable>False</IsPackable>
6+
<NoWarn>$(NoWarn),IDE1006</NoWarn>
67
</PropertyGroup>
78

89
<ItemGroup>

Minio/ApiEndpoints/BucketOperations.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ public async IAsyncEnumerable<Item> ListObjectsEnumAsync(ListObjectsArgs args,
282282
yield return item;
283283

284284
var prefixes = from c in root.Root.Descendants(ns + "CommonPrefixes")
285-
select new Item { Key = c.Element(ns + "Prefix")?.Value, IsDir = true };
285+
select new Item { Key = c.Element(ns + "Prefix")?.Value, IsDir = true };
286286
foreach (var item in prefixes)
287287
yield return item;
288288

Minio/ApiEndpoints/ObjectOperations.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -696,10 +696,8 @@ public async Task CopyObjectAsync(CopyObjectArgs args, CancellationToken cancell
696696
throw new InvalidDataException($"Specified byte range ({args.SourceObject
697697
.CopyOperationConditions
698698
.byteRangeStart.ToString(CultureInfo.InvariantCulture)}-{args.SourceObject
699-
.CopyOperationConditions.byteRangeEnd.ToString(CultureInfo.InvariantCulture)
700-
}) does not fit within source object (size={args.SourceObjectInfo.Size
701-
.ToString(CultureInfo.InvariantCulture)
702-
})");
699+
.CopyOperationConditions.byteRangeEnd.ToString(CultureInfo.InvariantCulture)}) does not fit within source object (size={args.SourceObjectInfo.Size
700+
.ToString(CultureInfo.InvariantCulture)})");
703701

704702
if (copySize > Constants.MaxSingleCopyObjectSize ||
705703
(srcByteRangeSize > 0 &&
@@ -933,7 +931,9 @@ private async Task<IDictionary<int, string>> PutObjectPartAsync(PutObjectPartArg
933931
numPartsUploaded++;
934932
totalParts[partNumber - 1] = new Part
935933
{
936-
PartNumber = partNumber, ETag = etag, Size = (long)expectedReadSize
934+
PartNumber = partNumber,
935+
ETag = etag,
936+
Size = (long)expectedReadSize
937937
};
938938
etags[partNumber] = etag;
939939
if (!dataToCopy.IsEmpty) progressReport.TotalBytesTransferred += dataToCopy.Length;
@@ -1026,7 +1026,9 @@ private async Task MultipartCopyUploadAsync(MultipartCopyUploadArgs args,
10261026

10271027
totalParts[partNumber - 1] = new Part
10281028
{
1029-
PartNumber = partNumber, ETag = cpPartResult.ETag, Size = (long)expectedReadSize
1029+
PartNumber = partNumber,
1030+
ETag = cpPartResult.ETag,
1031+
Size = (long)expectedReadSize
10301032
};
10311033
}
10321034

Minio/DataModel/Args/RemoveObjectsArgs.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ public RemoveObjectsArgs WithObjectsVersions(IList<Tuple<string, List<string>>>
5353
throw new ArgumentNullException(nameof(objectsVersionsList));
5454

5555
foreach (var objVersions in objectsVersionsList)
56-
foreach (var vid in objVersions.Item2)
57-
ObjectNamesVersions.Add(new Tuple<string, string>(objVersions.Item1, vid));
56+
foreach (var vid in objVersions.Item2)
57+
ObjectNamesVersions.Add(new Tuple<string, string>(objVersions.Item1, vid));
5858

5959
return this;
6060
}

Minio/DataModel/Response/GetMultipartUploadsListResponse.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ internal GetMultipartUploadsListResponse(HttpStatusCode statusCode, string respo
3636
var itemCheck = root.Root.Descendants(ns + "Upload").FirstOrDefault();
3737
if (uploadsResult is null || itemCheck?.HasElements != true) return;
3838
var uploads = from c in root.Root.Descendants(ns + "Upload")
39-
select new Upload
40-
{
41-
Key = c.Element(ns + "Key").Value,
42-
UploadId = c.Element(ns + "UploadId").Value,
43-
Initiated = c.Element(ns + "Initiated").Value
44-
};
39+
select new Upload
40+
{
41+
Key = c.Element(ns + "Key").Value,
42+
UploadId = c.Element(ns + "UploadId").Value,
43+
Initiated = c.Element(ns + "Initiated").Value
44+
};
4545
UploadResult = new Tuple<ListMultipartUploadsResult, List<Upload>>(uploadsResult, uploads.ToList());
4646
}
4747

Minio/HttpRequestMessageBuilder.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,19 @@ public HttpRequestMessage Request
7676
switch (key)
7777
{
7878
case "content-type":
79-
{
80-
val ??= "application/octet-stream";
81-
try
8279
{
83-
request.Content.Headers.ContentType = new MediaTypeHeaderValue(val);
80+
val ??= "application/octet-stream";
81+
try
82+
{
83+
request.Content.Headers.ContentType = new MediaTypeHeaderValue(val);
84+
}
85+
catch
86+
{
87+
var success = request.Content.Headers.TryAddWithoutValidation(ContentTypeKey, val);
88+
}
89+
90+
break;
8491
}
85-
catch
86-
{
87-
var success = request.Content.Headers.TryAddWithoutValidation(ContentTypeKey, val);
88-
}
89-
90-
break;
91-
}
9292

9393
case "content-length":
9494
request.Content.Headers.ContentLength = Convert.ToInt32(val, CultureInfo.InvariantCulture);

0 commit comments

Comments
 (0)