Merged
Conversation
Contributor
There was a problem hiding this comment.
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
This file contains hidden or 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
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.
No description provided.