Skip to content

Commit 9732e74

Browse files
authored
Fix code style warnings and code clean up (#517)
1 parent dd9915d commit 9732e74

File tree

59 files changed

+49
-94
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+49
-94
lines changed

applications/evaluation/Evaluators/AnswerCorrectness/StatementEvaluation.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Copyright (c) Microsoft. All rights reserved.
22

3+
// ReSharper disable CheckNamespace
4+
35
namespace Microsoft.KernelMemory.Evaluators.AnswerCorrectness;
46

57
#pragma warning disable CA1812 // 'StatementEvaluation' is an internal class that is apparently never instantiated. If so, remove the code from the assembly. If this class is intended to contain only static members, make it 'static' (Module in Visual Basic). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1812)

applications/evaluation/Evaluators/ContextRecall/GroundTruthClassification.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Copyright (c) Microsoft. All rights reserved.
22

3+
// ReSharper disable CheckNamespace
4+
35
namespace Microsoft.KernelMemory.Evaluators.ContextRecall;
46

57
#pragma warning disable CA1812 // 'GroundTruthClassification' is an internal class that is apparently never instantiated. If so, remove the code from the assembly. If this class is intended to contain only static members, make it 'static' (Module in Visual Basic). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1812)

applications/evaluation/Evaluators/ContextRelevancy/ContextRelevancy.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Copyright (c) Microsoft. All rights reserved.
22

3+
// ReSharper disable CheckNamespace
4+
35
namespace Microsoft.KernelMemory.Evaluators.ContextRelevancy;
46

57
#pragma warning disable CA1812 // 'ContextRelevancy' is an internal class that is apparently never instantiated. If so, remove the code from the assembly. If this class is intended to contain only static members, make it 'static' (Module in Visual Basic). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1812)

applications/evaluation/Evaluators/Faithfulness/StatementEvaluation.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Copyright (c) Microsoft. All rights reserved.
22

3+
// ReSharper disable CheckNamespace
4+
35
namespace Microsoft.KernelMemory.Evaluators.Faithfulness;
46

57
#pragma warning disable CA1812 // 'StatementEvaluation' is an internal class that is apparently never instantiated. If so, remove the code from the assembly. If this class is intended to contain only static members, make it 'static' (Module in Visual Basic). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1812)

applications/evaluation/Evaluators/Relevance/RelevanceEvaluation.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Copyright (c) Microsoft. All rights reserved.
22

3+
// ReSharper disable CheckNamespace
4+
35
namespace Microsoft.KernelMemory.Evaluators.Relevance;
46

57
#pragma warning disable CA1812 // 'RelevanceEvaluation' is an internal class that is apparently never instantiated. If so, remove the code from the assembly. If this class is intended to contain only static members, make it 'static' (Module in Visual Basic). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1812)

clients/dotnet/SemanticKernelPlugin/Internals/TypeConverter.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,10 @@
99
namespace Microsoft.KernelMemory.SemanticKernelPlugin.Internals;
1010

1111
[TypeConverter(typeof(TypeConverter))]
12-
public class TagCollectionWrapper : TagCollection
13-
{
14-
}
12+
public class TagCollectionWrapper : TagCollection;
1513

1614
[TypeConverter(typeof(TypeConverter))]
17-
public class ListOfStringsWrapper : List<string>
18-
{
19-
}
15+
public class ListOfStringsWrapper : List<string>;
2016

2117
#pragma warning disable CA1812 // required by SK
2218
internal sealed class TypeConverter : System.ComponentModel.TypeConverter

examples/001-dotnet-WebClient/Program.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// Copyright (c) Microsoft. All rights reserved.
22

3-
// ReSharper disable InconsistentNaming
4-
// ReSharper disable CommentTypo
5-
63
#pragma warning disable CS8602 // memory is initialized before usage
74
#pragma warning disable CS0162 // unreachable code is managed via boolean settings
85

@@ -504,18 +501,18 @@ Azure Active Directory (AAD) authentication mechanism. To test this locally, you
504501
// Download file and print details
505502
private static async Task DownloadFile()
506503
{
507-
const string filename = "file1-Wikipedia-Carbon.txt";
504+
const string Filename = "file1-Wikipedia-Carbon.txt";
508505

509506
Console.WriteLine("Downloading file");
510-
StreamableFileContent result = await s_memory.ExportFileAsync(documentId: "doc001", fileName: filename);
507+
StreamableFileContent result = await s_memory.ExportFileAsync(documentId: "doc001", fileName: Filename);
511508
var stream = new MemoryStream();
512509
await (await result.GetStreamAsync()).CopyToAsync(stream);
513510
var bytes = stream.ToArray();
514511

515512
Console.WriteLine();
516-
Console.WriteLine("Original File name : " + filename);
517-
Console.WriteLine("Original File size : " + new FileInfo(filename).Length);
518-
Console.WriteLine("Original Bytes count: " + (await File.ReadAllBytesAsync(filename)).Length);
513+
Console.WriteLine("Original File name : " + Filename);
514+
Console.WriteLine("Original File size : " + new FileInfo(Filename).Length);
515+
Console.WriteLine("Original Bytes count: " + (await File.ReadAllBytesAsync(Filename)).Length);
519516
Console.WriteLine();
520517
Console.WriteLine("Downloaded File name : " + result.FileName);
521518
Console.WriteLine("Downloaded File type : " + result.FileType);

examples/003-dotnet-SemanticKernel-plugin/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
public static class Program
88
{
9-
// ReSharper disable InconsistentNaming
109
public static async Task Main()
1110
{
1211
const string DocFilename = "mydocs-NASA-news.pdf";

examples/101-dotnet-custom-Prompts/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
public static class Program
77
{
8-
// ReSharper disable InconsistentNaming
98
public static async Task Main()
109
{
1110
var azureOpenAITextConfig = new AzureOpenAIConfig();

examples/106-dotnet-retrieve-synthetics/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ await memory.ImportDocumentAsync(new Document("doc1")
4545
Console.WriteLine($"== {result.SourceName} summary ==\n{result.Partitions.First().Text}\n");
4646
}
4747

48-
// ReSharper disable CommentTypo
4948
/*
5049
5150
OUTPUT:

0 commit comments

Comments
 (0)