Skip to content

Commit d97cb5f

Browse files
authored
1 parent 23e4f06 commit d97cb5f

File tree

95 files changed

+13238
-2417
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+13238
-2417
lines changed

.csharpierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NuGet.Versioning/**

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: "CI & CD: Build & Test & Lint .NET Solution, Create & Validate & Publish N
33
on:
44
push:
55
branches:
6-
- "**"
6+
- "master"
77
tags:
88
- "v[0-9]+.[0-9]+.[0-9]+"
99
pull_request:
@@ -57,7 +57,7 @@ jobs:
5757
- name: Restore .NET tools
5858
run: dotnet tool restore
5959

60-
- name: Linting
60+
- name: Run linting
6161
run: dotnet csharpier --check .
6262

6363
job_analyze_codeql:
@@ -195,15 +195,15 @@ jobs:
195195
with:
196196
global-json-file: "./global.json"
197197

198-
- name: Install nuget validator
198+
- name: Install NuGet validator
199199
run: dotnet tool install Meziantou.Framework.NuGetPackageValidation.Tool --global
200200

201201
- uses: actions/download-artifact@v4
202202
with:
203203
name: ${{ env.NuGetArtifactName }}
204204
path: ${{ env.NuGetDirectory }}
205205

206-
- name: Validate package
206+
- name: Validate NuGet package
207207
shell: pwsh
208208
run: meziantou.validate-nuget-package (Get-ChildItem "${{ env.NuGetDirectory }}/*.nupkg")
209209

Directory.Packages.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
1313
<PackageVersion Include="Moq" Version="4.20.72" />
1414
<PackageVersion Include="Moq.Contrib.HttpClient" Version="1.4.0" />
15+
<PackageVersion Include="PosInformatique.Moq.Analyzers" Version="1.10.0" />
1516
<PackageVersion Include="Semver" Version="2.3.0" />
1617
<PackageVersion Include="Verify.Xunit" Version="27.0.1" />
1718
<PackageVersion Include="xunit" Version="2.9.2" />
1819
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
1920
</ItemGroup>
20-
</Project>
21+
</Project>

Jvw.DevToys.SemverCalculator.Tests/Converters/DevToysElementConverter.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ public override void Write(VerifyJsonWriter writer, IUIElement element)
3333
{
3434
writer.WriteMember(element, "{has close action}", prop.Name);
3535
}
36+
else if (IsSelectDropDownListItemSelectedAction(element, name, val))
37+
{
38+
writer.WriteMember(element, "{has selected item action}", prop.Name);
39+
}
3640
else
3741
{
3842
writer.WritePropertyName(name);
@@ -66,4 +70,22 @@ private static bool IsInfoBarCloseAction(IUIElement element, string name, object
6670
{
6771
return element is IUIInfoBar && name == nameof(IUIInfoBar.OnCloseAction) && val is not null;
6872
}
73+
74+
/// <summary>
75+
/// Detect if property is `OnItemSelectedAction` from a select dropdown list.
76+
/// </summary>
77+
/// <param name="element">Element.</param>
78+
/// <param name="name">Property name.</param>
79+
/// <param name="val">Property value.</param>
80+
/// <returns>Whether property is `OnItemSelectedAction` from a select dropdown list.</returns>
81+
private static bool IsSelectDropDownListItemSelectedAction(
82+
IUIElement element,
83+
string name,
84+
object? val
85+
)
86+
{
87+
return element is IUISelectDropDownList
88+
&& name == nameof(IUISelectDropDownList.OnItemSelectedAction)
89+
&& val is not null;
90+
}
6991
}

Jvw.DevToys.SemverCalculator.Tests/Jvw.DevToys.SemverCalculator.Tests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
<PackageReference Include="Microsoft.NET.Test.Sdk" />
2727
<PackageReference Include="Moq" />
2828
<PackageReference Include="Moq.Contrib.HttpClient" />
29+
<PackageReference Include="PosInformatique.Moq.Analyzers">
30+
<PrivateAssets>all</PrivateAssets>
31+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
32+
</PackageReference>
2933
<PackageReference Include="Verify.Xunit" />
3034
<PackageReference Include="xunit" />
3135
<PackageReference Include="xunit.runner.visualstudio">

Jvw.DevToys.SemverCalculator.Tests/TestModuleInitializer.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ public static void Initialize()
2020
// Don't scrub Guids.
2121
VerifierSettings.DontScrubGuids();
2222

23+
// Ignore exception stack traces.
24+
VerifierSettings.IgnoreStackTrace();
25+
2326
VerifierSettings.AddExtraSettings(settings =>
2427
{
2528
// Export all properties, including those with default values.

0 commit comments

Comments
 (0)