Skip to content

Commit 7484a5e

Browse files
authored
feat!: Initial CSharpCodeBuilder (#4)
* feat!: Initial CSharpCodeBuilder * chore: Abstract Base class * chore: Additional methods for XMLDocs * fix: Use Expression body * style: Reformatted code * chore(deps): Updated nuget packages * style: Reformatted code * chore: Removed additional editorconfig
1 parent 8f56175 commit 7484a5e

35 files changed

+4721
-66
lines changed

.editorconfig

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ indent_style = space
1111
trim_trailing_whitespace = true
1212
charset = utf-8
1313
end_of_line = lf
14+
max_line_length = 120
1415

1516
# Verify settings
1617
# https://github.com/VerifyTests/Verify?tab=readme-ov-file#text-file-settings
@@ -24,7 +25,7 @@ tab_width = unset
2425
trim_trailing_whitespace = false
2526

2627
# Code files
27-
[*.{cs,csx,vb,vbx}]
28+
[*.{cs,csx,vb,vbx,razor,razor.cs}]
2829
indent_size = 4
2930
insert_final_newline = true
3031
charset = utf-8-bom
@@ -34,6 +35,7 @@ charset = utf-8-bom
3435
# See https://github.com/dotnet/aspnetcore/pull/23502 and https://github.com/dotnet/aspnetcore/issues/22753
3536
[*.{razor,cshtml}]
3637
charset = utf-8-bom
38+
indent_size = 4
3739

3840
# Generated code
3941
[*{_AssemblyInfo.cs,.notsupported.cs,.generated.cs}]
@@ -121,7 +123,7 @@ dotnet_style_null_propagation = true :
121123

122124
# Modifier preferences
123125
# See https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#normalize-modifiers
124-
dotnet_style_require_accessibility_modifiers = always : error
126+
dotnet_style_require_accessibility_modifiers = for_non_interface_members : error
125127
dotnet_style_readonly_field = true : warning
126128

127129
# Required Styles
@@ -276,3 +278,7 @@ dotnet_diagnostic.SA1502.severity = none
276278
dotnet_diagnostic.SA1504.severity = none
277279
dotnet_diagnostic.SA1515.severity = none
278280
dotnet_diagnostic.SA1516.severity = none
281+
282+
# Support for NetEvolve.Arguments Methods
283+
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1062#null-check-validation-methods
284+
dotnet_code_quality.CA1062.null_check_validation_methods = M:NetEvolve.Arguments.Argument.ThrowIfNull(System.Object,System.String)|M:NetEvolve.Arguments.Argument.ThrowIfNull(System.Void*,System.String)|M:NetEvolve.Arguments.Argument.ThrowIfNullOrEmpty(System.String,System.String)|M:NetEvolve.Arguments.Argument.ThrowIfNullOrEmpty``1(System.Collections.Generic.IEnumerable{``0},System.String)|M:NetEvolve.Arguments.Argument.ThrowIfNullOrWhiteSpace(System.String,System.String)

.github/workflows/cicd.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,18 @@ on:
1818
- detailed
1919
- diagnostic
2020

21+
permissions:
22+
actions: read
23+
contents: read
24+
pull-requests: write
25+
security-events: write
26+
2127
jobs:
2228
all:
2329
if: github.run_id != 1
24-
name: Build & Tests
25-
uses: dailydevops/pipelines/.github/workflows/cicd-dotnet.yml@0.14.110
30+
uses: dailydevops/pipelines/.github/workflows/build-dotnet-single.yml@1.0.8
2631
with:
27-
disablePublish: true
28-
dotnet-logging: ${{ inputs.dotnet-logging }}
29-
dotnet-version: ${{ vars.NE_DOTNET_TARGETFRAMEWORKS }}
30-
enableSonarQube: ${{ vars.NE_DOTNET_SONAR }}
31-
solution: ###SOLUTION###
32+
dotnetVersion: ${{ vars.NE_DOTNET_TARGETFRAMEWORKS }}
33+
dotnetQuality: ${{ vars.NE_DOTNET_QUALITY }}
34+
solution: ./HealthChecks.slnx
3235
secrets: inherit

CodeBuilder.sln

Lines changed: 0 additions & 39 deletions
This file was deleted.

CodeBuilder.slnx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Solution>
2+
<Folder Name="/Solution Items/">
3+
<File Path=".commitlintrc" />
4+
<File Path=".editorconfig" />
5+
<File Path=".filenesting.json" />
6+
<File Path=".gitattributes" />
7+
<File Path=".gitignore" />
8+
<File Path="Directory.Build.props" />
9+
<File Path="Directory.Packages.props" />
10+
<File Path="Directory.Solution.props" />
11+
<File Path="GitVersion.yml" />
12+
<File Path="LICENSE" />
13+
<File Path="logo.png" />
14+
<File Path="nuget.config" />
15+
<File Path="README.md" />
16+
<File Path="testEnvironments.json" />
17+
</Folder>
18+
<Folder Name="/src/">
19+
<Project Path="src/NetEvolve.CodeBuilder/NetEvolve.CodeBuilder.csproj" />
20+
</Folder>
21+
<Folder Name="/tests/">
22+
<Project Path="tests/NetEvolve.CodeBuilder.Tests.Unit/NetEvolve.CodeBuilder.Tests.Unit.csproj" />
23+
</Folder>
24+
</Solution>

Directory.Build.props

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
<Project>
2-
32
<PropertyGroup Label="Package settings">
43
<Title>$(MSBuildProjectName)</Title>
5-
<Description></Description>
6-
<RepositoryUrl></RepositoryUrl>
7-
<PackageProjectUrl></PackageProjectUrl>
4+
<Description>Provides a high-performance, memory-efficient builder for creating C# code.</Description>
5+
<RepositoryUrl>https://github.com/dailydevops/codebuilder.git</RepositoryUrl>
6+
<PackageProjectUrl>https://github.com/dailydevops/codebuilder</PackageProjectUrl>
87
<PackageReleaseNotes>$(RepositoryUrl)/releases</PackageReleaseNotes>
9-
<PackageTags></PackageTags>
8+
<PackageTags>$(PackageTags);codegeneration;sourcegenrator</PackageTags>
109
<CopyrightYearStart>2024</CopyrightYearStart>
10+
<_DefaultTargetFrameworks>net8.0;net9.0;net10.0</_DefaultTargetFrameworks>
11+
<_ProjectTargetFrameworks>netstandard2.0;netstandard2.1;$(_DefaultTargetFrameworks)</_ProjectTargetFrameworks>
12+
<_TestTargetFrameworks>net6.0;net7.0;$(_DefaultTargetFrameworks)</_TestTargetFrameworks>
13+
<CheckEolTargetFramework>false</CheckEolTargetFramework>
1114
</PropertyGroup>
12-
1315
<PropertyGroup>
1416
<!-- Workaround, until https://github.com/GitTools/GitVersion/pull/4206 is released -->
15-
<GitVersionTargetFramework>net8.0</GitVersionTargetFramework>
17+
<GitVersionTargetFramework>net9.0</GitVersionTargetFramework>
1618
</PropertyGroup>
17-
1819
</Project>

Directory.Packages.props

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
<Project>
2-
32
<PropertyGroup>
43
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
54
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
65
</PropertyGroup>
7-
86
<ItemGroup>
9-
<GlobalPackageReference Include="CSharpier.MSBuild" Version="0.30.6" />
10-
<GlobalPackageReference Include="GitVersion.MsBuild" Version="6.1.0" />
11-
<GlobalPackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
7+
<GlobalPackageReference Include="CSharpier.MSBuild" Version="1.0.3" />
8+
<GlobalPackageReference Include="GitVersion.MsBuild" Version="6.3.0" />
9+
<GlobalPackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="4.14.0" />
1210
<GlobalPackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0" />
1311
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
14-
<GlobalPackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.12.19" />
15-
<GlobalPackageReference Include="NetEvolve.Defaults" Version="1.3.39" />
16-
<GlobalPackageReference Include="SonarAnalyzer.CSharp" Version="10.5.0.109200" Condition=" '$(BuildingInsideVisualStudio)' == 'true' " />
12+
<GlobalPackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.14.15" />
13+
<GlobalPackageReference Include="NetEvolve.Defaults" Version="1.3.115" />
14+
<GlobalPackageReference Include="SonarAnalyzer.CSharp" Version="10.13.0.120203" />
15+
</ItemGroup>
16+
<ItemGroup>
17+
<PackageVersion Include="NetEvolve.Extensions.TUnit" Version="2.6.26" />
18+
<PackageVersion Include="System.Memory" Version="4.6.3" />
19+
<PackageVersion Include="TUnit" Version="0.25.21" />
1720
</ItemGroup>
18-
1921
</Project>

0 commit comments

Comments
 (0)