Skip to content

Commit ce6462e

Browse files
authored
hydrascript 2 5 0 +semver:feature (#204)
* #54 - implement missing return statement check * #54 - update function analysis to track return statements and code path completeness * #54 - add ReturnAnalyzer service to DI * #196 - handle string values directly in AsString instruction * #196 - add unit tests for AsString quote case * #54 - add unit and integration tests for missing return statement analysis * #54 - move `AllCodePathsEndedWithReturn` from `FunctionSymbol` to `FunctionDeclaration` * #191 - update to .NET 10 * #174 - refactor AsStringSerializationContext * #192 - migrate to stable `System.CommandLine` 2.0.0 and remove unused `NuGet.config` file * #191 - update benchmarks to .NET 10, upgrade BenchmarkDotNet to 0.15.6 * #191 - bump package versions * #191 - update test configurations for mtp-v2 * #191 - csharp-14 null prop assignment * #191 - replace backing fields with `field` keyword for automatic properties * #191 - update visit `WithExpression` to use `IdentifierReference` for `copyFrom` initialization * #191 - fix ComplexLiteral Id * add output ComplexLiteralId * #191 - use compiled regex
1 parent d087b15 commit ce6462e

File tree

40 files changed

+319
-159
lines changed

40 files changed

+319
-159
lines changed

.github/workflows/develop.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Setup .NET
2828
uses: actions/setup-dotnet@v5
2929
with:
30-
dotnet-version: 9.0.x
30+
dotnet-version: 10.0.x
3131
- name: Setup GitVersion
3232
uses: gittools/actions/gitversion/[email protected]
3333
with:
@@ -50,16 +50,16 @@ jobs:
5050
- name: Build
5151
run: dotnet build /p:Version=${{ steps.version_step.outputs.fullSemVer }} --no-restore -c Debug -v n
5252
- name: Unit Tests
53-
run: dotnet test -c Debug --no-build -v n -- --filter-trait Category=Unit --ignore-exit-code 8
53+
run: dotnet test -c Debug --no-build -v n --filter-trait Category=Unit
5454
- name: Integration Tests
5555
run: |
56-
dotnet test tests/HydraScript.IntegrationTests -c Debug --no-build -v n -- --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml
56+
dotnet test --project tests/HydraScript.IntegrationTests -c Debug --no-build -v n --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml
5757
mkdir coverage-report
5858
- name: Code Coverage Summary Report For Merge Request
5959
if: github.event_name == 'pull_request'
6060
uses: 5monkeys/cobertura-action@master
6161
with:
62-
path: ./tests/HydraScript.IntegrationTests/bin/Debug/net9.0/TestResults/coverage.cobertura.xml
62+
path: ./tests/HydraScript.IntegrationTests/bin/Debug/net10.0/TestResults/coverage.cobertura.xml
6363
repo_token: ${{ secrets.GITHUB_TOKEN }}
6464
minimum_coverage: 80
6565
fail_below_threshold: true
@@ -71,7 +71,7 @@ jobs:
7171
- name: ReportGenerator
7272
uses: danielpalme/[email protected]
7373
with:
74-
reports: './tests/HydraScript.IntegrationTests/bin/Debug/net9.0/TestResults/coverage.cobertura.xml'
74+
reports: './tests/HydraScript.IntegrationTests/bin/Debug/net10.0/TestResults/coverage.cobertura.xml'
7575
targetdir: './coverage-report'
7676
- name: Upload coverage report artifact
7777
if: github.event_name == 'push'
@@ -84,4 +84,4 @@ jobs:
8484
uses: actions/upload-artifact@v4
8585
with:
8686
name: windows_build_${{ steps.version_step.outputs.fullSemVer }}
87-
path: ./src/HydraScript/bin/Debug/net9.0
87+
path: ./src/HydraScript/bin/Debug/net10.0

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
- name: Setup .NET
6363
uses: actions/setup-dotnet@v5
6464
with:
65-
dotnet-version: '9.0.x'
65+
dotnet-version: 10.0.x
6666
- name: Setup GitReleaseManager
6767
uses: gittools/actions/gitreleasemanager/[email protected]
6868
with:

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<TargetFramework>net9.0</TargetFramework>
3+
<TargetFramework>net10.0</TargetFramework>
44
<ImplicitUsings>enable</ImplicitUsings>
55
<Nullable>enable</Nullable>
66
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

Directory.Packages.props

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<Project>
22
<ItemGroup>
3-
<PackageVersion Include="BenchmarkDotNet" Version="0.15.4" />
3+
<PackageVersion Include="BenchmarkDotNet" Version="0.15.6" />
44
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0">
55
<PrivateAssets>all</PrivateAssets>
66
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
77
</PackageVersion>
8-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
9-
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.9" />
10-
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.9" />
11-
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.9" />
12-
<PackageVersion Include="Microsoft.Extensions.Options" Version="9.0.9" />
13-
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.24126.1" />
8+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.0.0" />
9+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.0" />
10+
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.0" />
11+
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.0" />
12+
<PackageVersion Include="Microsoft.Extensions.Options" Version="10.0.0" />
13+
<PackageVersion Include="System.CommandLine" Version="2.0.0" />
1414
<PackageVersion Include="System.IO.Abstractions" Version="22.0.16" />
1515
<PackageVersion Include="Visitor.NET" Version="4.2.0" />
1616
<PackageVersion Include="Visitor.NET.AutoVisitableGen" Version="1.5.2" />
17-
<PackageVersion Include="ZLinq" Version="1.5.2" />
17+
<PackageVersion Include="ZLinq" Version="1.5.4" />
1818
<PackageVersion Include="ZLogger" Version="2.5.10" />
1919
<PackageVersion Include="ZString" Version="2.6.0" />
2020
</ItemGroup>

ExtendedJavaScriptSubset.slnx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Solution>
22
<Folder Name="/Benchmarks/">
3-
<Project Path="benchmarks\HydraScript.Benchmarks\HydraScript.Benchmarks.csproj" Type="Classic C#" />
3+
<Project Path="benchmarks\HydraScript.Benchmarks\HydraScript.Benchmarks.csproj" Type="C#" />
44
<File Path="benchmarks\Readme.md" />
55
</Folder>
66
<Folder Name="/SolutionItems/">
@@ -10,9 +10,9 @@
1010
<File Path="Directory.Build.props" />
1111
<File Path="Directory.Packages.props" />
1212
<File Path="GitVersion.yml" />
13+
<File Path="global.json" />
1314
<File Path="hydrascript-logo.jpg" />
1415
<File Path="LICENSE" />
15-
<File Path="NuGet.config" />
1616
<File Path="Readme.md" />
1717
<File Path="SECURITY.md" />
1818
</Folder>

NuGet.config

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

benchmarks/HydraScript.Benchmarks/InvokeBenchmark.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
1-
using System.Diagnostics.CodeAnalysis;
21
using BenchmarkDotNet.Attributes;
32
using BenchmarkDotNet.Jobs;
4-
using BenchmarkDotNet.Running;
5-
using HydraScript.Benchmarks;
63
using HydraScript.Infrastructure;
74
using Microsoft.Extensions.DependencyInjection;
85
using Microsoft.Extensions.Logging;
96
using Microsoft.Extensions.Logging.Abstractions;
107
using Microsoft.Extensions.Options;
118

12-
[assembly: ExcludeFromCodeCoverage]
9+
namespace HydraScript.Benchmarks;
1310

14-
BenchmarkRunner.Run<InvokeBenchmark>();
15-
16-
[SimpleJob(RuntimeMoniker.Net90)]
17-
[SimpleJob(RuntimeMoniker.NativeAot90)]
11+
[SimpleJob(RuntimeMoniker.Net10_0)]
12+
[SimpleJob(RuntimeMoniker.NativeAot10_0)]
1813
[MemoryDiagnoser]
1914
public class InvokeBenchmark
2015
{
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
using System.Diagnostics.CodeAnalysis;
2+
using BenchmarkDotNet.Running;
3+
using HydraScript.Benchmarks;
4+
5+
[assembly: ExcludeFromCodeCoverage]
6+
7+
BenchmarkRunner.Run<InvokeBenchmark>();

benchmarks/Readme.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
```
2-
3-
BenchmarkDotNet v0.15.4, macOS Ventura 13.7.2 (22H313) [Darwin 22.6.0]
4-
Apple M1 Pro, 1 CPU, 10 logical and 10 physical cores
5-
.NET SDK 9.0.305
6-
[Host] : .NET 9.0.9 (9.0.9, 9.0.925.41916), Arm64 RyuJIT armv8.0-a
7-
.NET 9.0 : .NET 9.0.9 (9.0.9, 9.0.925.41916), Arm64 RyuJIT armv8.0-a
8-
NativeAOT 9.0 : .NET 9.0.9, Arm64 NativeAOT armv8.0-a
9-
10-
2+
BenchmarkDotNet v0.15.6, Windows 10 (10.0.19045.6456/22H2/2022Update)
3+
12th Gen Intel Core i7-12650H 2.30GHz, 1 CPU, 16 logical and 10 physical cores
4+
.NET SDK 10.0.100
5+
[Host] : .NET 10.0.0 (10.0.0, 10.0.25.52411), X64 RyuJIT x86-64-v3
6+
.NET 10.0 : .NET 10.0.0 (10.0.0, 10.0.25.52411), X64 RyuJIT x86-64-v3
7+
NativeAOT 10.0 : .NET 10.0.0, X64 NativeAOT x86-64-v3
118
```
12-
| Method | Job | Runtime | Mean | Error | StdDev | Gen0 | Gen1 | Allocated |
13-
|--------|---------------|---------------|---------:|----------:|----------:|----------:|---------:|----------:|
14-
| Invoke | .NET 9.0 | .NET 9.0 | 9.525 ms | 0.1615 ms | 0.1658 ms | 1562.5000 | 500.0000 | 9.37 MB |
15-
| Invoke | NativeAOT 9.0 | NativeAOT 9.0 | 7.321 ms | 0.0544 ms | 0.0509 ms | 1562.5000 | 468.7500 | 9.36 MB |
9+
10+
| Method | Job | Runtime | Mean | Error | StdDev | Gen0 | Gen1 | Allocated |
11+
|--------|----------------|----------------|----------:|----------:|----------:|---------:|---------:|----------:|
12+
| Invoke | .NET 10.0 | .NET 10.0 | 11.569 ms | 0.2307 ms | 0.4966 ms | 828.1250 | 312.5000 | 10.04 MB |
13+
| Invoke | NativeAOT 10.0 | NativeAOT 10.0 | 8.227 ms | 0.1093 ms | 0.0969 ms | 828.1250 | 218.7500 | 10.05 MB |

global.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"test": {
3+
"runner": "Microsoft.Testing.Platform"
4+
}
5+
}

0 commit comments

Comments
 (0)