-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor SKonsole Commands and Improve Code Consistency #7
Merged
Conversation
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
Configure VSCode settings to enable auto-formatting and exclude certain files. Add recommended extensions for C# development and spell checking.
This commit updates the .editorconfig file with new diagnostic rules, naming conventions, and settings for various file types, such as XML, JSON, TypeScript, C#, and Java. It also enforces .NET coding conventions and sets diagnostic severity levels for warnings and errors. Additionally, the ConfigCommand.cs, ConfigurationProvider, Program, EmailSkill, GitSkill, and WriterSkill classes have been refactored to improve code consistency, maintainability, and error handling.
Implement a new KernelProvider class to manage the creation and configuration of the SemanticKernel. Add utility classes for handling configuration variables and logging setup. This improves the overall structure and maintainability of the code.
This commit introduces a new CommitCommand class to handle commit messages and refactors the logging setup into a separate utility class. It also simplifies the handling of git diff output by removing unnecessary process calls and stream reading. The changes include: - Create CommitCommand class with GenerateCommitMessageCommand method - Move RunCommitMessage logic from Program.cs to CommitCommand.cs - Refactor logging setup into Logging.GetFactory method - Update Program.cs to use new CommitCommand and Logging classes - Remove ConfigVar method and replace it with a direct call to the Configuration.ConfigVar method
This commit improves the logging system by setting the minimum log level and adding a logger to the CommitCommand class. It also refactors the RunCommitMessage method to accept a logger as a parameter and updates the Program.cs file to include the logger.
- Extracted PRCommand logic into a separate class - Added GeneratePRFeedbackCommand and GeneratePRDescriptionCommand methods - Updated Program.cs to use the new PRCommand class - Removed redundant code from Program.cs
This commit addresses two main changes: 1. Properly pass the `token` parameter to the `kernel.RunAsync` method in both `CommitCommand.cs` and `PRCommand.cs`. 2. Add a missing comma in `CommitCommand.cs` to correctly set the `StandardOutputEncoding` property.
This commit introduces a new PlannerCommand class that handles the planning functionality. It has been integrated with the root command, replacing the previous implementation. The PlannerCommand class now generates a CreatePlan subcommand and handles its execution. The RunCreatePlan method has been moved into the PlannerCommand class, simplifying the Program.cs file.
Add a new PromptChatCommand class to handle chat functionality with the prompt bot. This class includes methods for generating the command, running the chat, and reading multi-line input. The main Program.cs file has been updated to use the new PromptChatCommand class, simplifying the code and improving organization.
Update the launch.json file to include an args array for the SKonsole.dll program. This allows passing arguments to the program when debugging in VSCode.
FYI @xbotter |
Removed a large number of Java-specific formatting settings from the .editorconfig file. This change simplifies the configuration and focuses on the essential settings for the project.
lemillermicrosoft
changed the title
Refactor Commands
Refactor SKonsole Commands and Improve Code Consistency
Aug 15, 2023
xbotter
reviewed
Aug 15, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix a typo
Co-authored-by: xbotter <xbotter@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #6.
Summary:
This pull request introduces a series of changes aimed at refactoring the SKonsole codebase, improving code organization, maintainability, and consistency. The main changes involve updating Java formatting settings, refactoring SKonsole commands, improving exception handling, and adding new settings and recommendations for Visual Studio Code.
Detailed List of Changes:
.editorconfig
file, such as spacing rules for various operators, parentheses, and braces.SKonsole
commands in theConfigCommand.cs
andConfigurationProvider.cs
files, including the use ofthis
keyword for instance members, updating class declarations to be sealed, and refining exception handling.ConfigurationProvider.cs
by handling specific exceptions:JsonException
,NotSupportedException
, andArgumentNullException
.using System.CommandLine.Builder;
directive and wrappedloggerFactory
in ausing
statement inProgram.cs
.if
statements inProgram.cs
for improved readability.internal class
tointernal sealed class
inEmailSkill.cs
,GitSkill.cs
, andWriterSkill.cs
..vscode/settings.json
file with settings for formatting, bracket pair colorization, file exclusions, and custom words for the spell checker.extensions.json
file with recommendations for Visual Studio Code extensions, including C# support, Semantic Kernel, and Code Spell Checker.These changes will help ensure that the project adheres to best practices and maintains a high level of code quality, consistency, and readability.