-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update and Refactor Codebase: Improve Async Usage, Package Management…
…, and Code Quality (#20) ## Summary This pull request includes a series of updates and refactoring efforts across the codebase, focusing on improving async usage, introducing central package management, updating package references, and enhancing code quality and readability. ## Changes - Remove unnecessary TODO comment and severity setting in .editorconfig - Set dotnet_diagnostic.CA2201.severity to none in .editorconfig - Add dotnet_diagnostic.VSTHRD200.severity setting in .editorconfig - Create Directory.Build.targets file to enable central package management and run 'dotnet format' on dev machines during Release builds - Create Directory.Packages.props file to centrally manage package versions and include analyzers - Enable central package management in Directory.Packages.props - Add package versions and package references for analyzers in Directory.Packages.props - Replace synchronous ReadToEnd with async ReadToEndAsync in multiple files - Remove unnecessary newline characters in ConfigCommand.cs - Change ConfigConstants class to static - Update package references in SKonsole.csproj to use the latest versions without specifying version numbers - Make GitDiffStaged method in GitSkill.cs async - Update CondenseSkill.cs to use 'this' keyword for better readability - Add RootNamespace to CondenseSkill.csproj - Updated CondenseSkill.csproj and PRSkill.csproj files - Refactored EnglishRobertaTokenizer.cs by making the class sealed - Removed unnecessary using directives in PullRequestSkill.cs - Updated PackageReference for Microsoft.SemanticKernel in PRSkill.csproj - Simplified object creation in RedirectTextCompletionResult.cs - Removed unnecessary whitespace and newline characters in various files - Made FormatInstructionsProvider a static class - Updated the output format instructions in FormatInstructionsProvider.cs --- *Powered by [Microsoft Semantic Kernel](https://github.com/microsoft/semantic-kernel)* * 🔧 Adjust .editorconfig settings and disable some diagnostics Update the .editorconfig file to disable some diagnostics, such as CA2201 and VSTHRD200, and remove the unnecessary severity setting for dotnet_analyzer_diagnostic. This change aims to improve code quality and maintainability while reducing unwanted changes introduced by "dotnet format". * 📦 Centralize package management and format on build Implement Central Package Management using Directory.Packages.props and Directory.Build.targets. This centralizes package versions and analyzers across all projects. Also, add a target to run 'dotnet format' on build for Release configurations in dev environments. Update the Microsoft.SemanticKernel package reference in PRSkill.csproj to use the latest version. This change ensures compatibility and performance improvements for the project. * 🔄 Replace ReadToEnd with ReadToEndAsync in commands This commit replaces the synchronous ReadToEnd method with the asynchronous ReadToEndAsync method in CommitCommand and PRCommand classes. It also makes ConfigConstants class static and removes unnecessary newlines in ConfigCommand. * 🔄 Update GitDiffStaged to use async-await This commit updates the GitDiffStaged method in GitSkill.cs to use async-await for better performance and readability. The method now returns an awaitable Task and reads the process output asynchronously. * 📝 Improve CondenseSkill and tokenizer consistency - Update method call to use `this` keyword for consistency - Add BOM to resource files for proper encoding - Change EnglishRobertaTokenizer class to sealed * 🔧 Refactor PRSkill and Utils classes - Remove unnecessary usings and reorder them - Simplify object initialization - Make FormatInstructionsProvider static - Minor formatting adjustments
- Loading branch information
1 parent
eab8cba
commit 59dc149
Showing
22 changed files
with
124 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Project> | ||
<!-- Direct all packages under 'dotnet' to get versions from Directory.Packages.props --> | ||
<!-- using Central Package Management feature --> | ||
<!-- https://learn.microsoft.com/en-us/nuget/consume-packages/Central-Package-Management --> | ||
<Sdk Name="Microsoft.Build.CentralPackageVersions" Version="2.1.3" /> | ||
<!-- Only run 'dotnet format' on dev machines, Release builds. Skip on GitHub Actions --> | ||
<!-- as this runs in its own Actions job. --> | ||
<Target Name="DotnetFormatOnBuild" BeforeTargets="Build" | ||
Condition=" '$(Configuration)' == 'Release' AND '$(GITHUB_ACTIONS)' == '' "> | ||
<Message Text="Running dotnet format" Importance="high" /> | ||
<Exec Command="dotnet format --no-restore -v diag $(ProjectFileName)" /> | ||
</Target> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<!-- Enable central package management --> | ||
<!-- https://learn.microsoft.com/en-us/nuget/consume-packages/Central-Package-Management --> | ||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" /> | ||
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" /> | ||
<PackageVersion Include="Microsoft.ML.Tokenizers" Version="0.21.0-preview.23266.6"/> | ||
<PackageVersion Include="Microsoft.SemanticKernel" Version="0.24.230918.1-preview" /> | ||
<PackageVersion Include="Microsoft.SemanticKernel.Skills.Web" Version="0.24.230918.1-preview" /> | ||
<PackageVersion Include="Microsoft.SemanticKernel.Planning.StepwisePlanner" Version="0.24.230918.1-preview" /> | ||
<PackageVersion Include="Microsoft.SemanticKernel.Reliability.Basic" Version="0.24.230918.1-preview" /> | ||
<PackageVersion Include="Spectre.Console" Version="0.47.0" /> | ||
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" /> | ||
<PackageVersion Include="TextCopy" Version="6.2.1" /> | ||
<!-- Analyzers --> | ||
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview1.23165.1" /> | ||
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" /> | ||
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.7.30" /> | ||
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageVersion Include="xunit.analyzers" Version="1.2.0" /> | ||
<PackageReference Include="xunit.analyzers"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageVersion Include="Moq.Analyzers" Version="0.0.9" /> | ||
<PackageReference Include="Moq.Analyzers"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageVersion Include="Roslynator.Analyzers" Version="4.3.0" /> | ||
<PackageReference Include="Roslynator.Analyzers"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageVersion Include="Roslynator.CodeAnalysis.Analyzers" Version="4.3.0" /> | ||
<PackageReference Include="Roslynator.CodeAnalysis.Analyzers"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageVersion Include="Roslynator.Formatting.Analyzers" Version="4.3.0" /> | ||
<PackageReference Include="Roslynator.Formatting.Analyzers"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
13 850314647 | ||
13 850314647 | ||
262 800385005 | ||
11 800251374 | ||
284 432911125 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
{ | ||
"!": 0, | ||
"\"": 1, | ||
"#": 2, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#version: 0.2 | ||
#version: 0.2 | ||
Ġ t | ||
Ġ a | ||
h e | ||
|
2 changes: 1 addition & 1 deletion
2
skills/CondenseSkill/SemanticFunctions/CondenseSkill/Condenser/config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
skills/CondenseSkill/SemanticFunctions/CondenseSkill/Condenser/skprompt.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[RESULTS] | ||
[RESULTS] | ||
{{$input}} | ||
[END RESULTS] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.