-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat!: Initial CSharpCodeBuilder #4
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
Conversation
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.
Pull Request Overview
This PR introduces the initial implementation of a CSharpCodeBuilder for constructing C# code snippets with automatic indentation, conditional appending, formatting support, and extensive unit tests.
- Implements
CodeBuilderBaseandCSharpCodeBuilderwithAppend,AppendLine,AppendIf,AppendLineIf,AppendFormat,EnsureCapacity,Clear, and XML-doc methods - Adds over 30 test files covering core behavior, properties, indentation, capacity, conditional logic, formatting, and documentation generation
- Updates project files (
Directory.Build.props,Directory.Packages.props), CI workflow, and solution structure to support multi-target frameworks and TUnit
Reviewed Changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/NetEvolve.CodeBuilder/CodeBuilderBase.EnsureIndented.cs | Added indentation helper and indent level APIs |
| src/NetEvolve.CodeBuilder/CSharpCodeBuilder.Append.cs | Core Append logic with brace-driven indenting |
| src/NetEvolve.CodeBuilder/CSharpCodeBuilder.AppendLineIf.cs | Conditional line-append overloads |
| src/NetEvolve.CodeBuilder/CSharpCodeBuilder.AppendFormat.cs | Culture-aware formatting methods |
| src/NetEvolve.CodeBuilder/CSharpCodeBuilder.Clear.cs | Reset content and indentation |
| src/NetEvolve.CodeBuilder/CSharpCodeBuilder.Documentation.cs | XML documentation comment methods |
| tests/NetEvolve.CodeBuilder.Tests.Unit/*.cs | Comprehensive unit tests for all APIs |
| .github/workflows/cicd.yml | Switched to single-pipeline build step |
Comments suppressed due to low confidence (3)
.github/workflows/cicd.yml:34
- The
solutionpath points toHealthChecks.slnxinstead of this repository'sCodeBuilder.slnx. Update to the correct solution filename.
solution: ./HealthChecks.slnx
src/NetEvolve.CodeBuilder/CodeBuilderBase.EnsureIndented.cs:3
- The
InterlockedAPI is used butSystem.Threadingis not imported. Addusing System.Threading;at the top of the file to resolve compilation errors.
using System.Runtime.CompilerServices;
src/NetEvolve.CodeBuilder/CSharpCodeBuilder.Clear.cs:3
Interlocked.Exchangeis used butSystem.Threadingis not imported. Addusing System.Threading;to this file.
public partial record CSharpCodeBuilder
No description provided.