Skip to content

Commit c3e5e2f

Browse files
committed
feat: Add formattting for WPF extension
1 parent 3fbce60 commit c3e5e2f

48 files changed

Lines changed: 1106 additions & 309 deletions

Some content is hidden

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

.editorconfig

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -348,14 +348,17 @@ dotnet_diagnostic.CA2242.severity = warning
348348
# Require file header OR A source file contains a header that does not match the required text
349349
dotnet_diagnostic.IDE0073.severity = error
350350

351+
dotnet_diagnostic.IDE0058.severity = silent
352+
353+
dotnet_diagnostic.MC3080.severity = none
354+
351355
# StyleCop Code Analysis
352356

353357
# Closing parenthesis should be spaced correctly: "foo()!"
354358
dotnet_diagnostic.SA1009.severity = none
355359

356360
# Hide warnings when using the new() expression from C# 9.
357361
dotnet_diagnostic.SA1000.severity = none
358-
359362
dotnet_diagnostic.SA1011.severity = none
360363
dotnet_diagnostic.SA1101.severity = none
361364

@@ -389,12 +392,16 @@ dotnet_diagnostic.SA1634.severity = none
389392
dotnet_diagnostic.SA1652.severity = none
390393

391394

392-
393395
# Additional Stylecop Analyzers
394396
dotnet_diagnostic.SA1111.severity = none
395397
dotnet_diagnostic.SA1121.severity = none
396398
dotnet_diagnostic.SA1204.severity = none
397399
dotnet_diagnostic.SA1208.severity = none
400+
dotnet_diagnostic.CS1591.severity = none # Missing XML comment for publicly visible type or member
401+
# 15000+ warnings in the solution
402+
dotnet_diagnostic.CA1510.severity = none # Use ArgumentNullException throw helper
403+
# doesn't work with older versions of .NET
404+
398405
dotnet_diagnostic.SA1518.severity = none
399406
dotnet_diagnostic.SA1615.severity = none
400407
dotnet_diagnostic.SA1502.severity = none
@@ -407,9 +414,5 @@ dotnet_diagnostic.WPF0071.severity = none # Add ValueConversion attribute
407414
dotnet_diagnostic.WPF0070.severity = none # Add default field to converter
408415

409416
# Suppress some IDE warnings
417+
dotnet_diagnostic.IDE0130.severity = none # Hide warnings about namespaces not matching folder structure
410418
dotnet_diagnostic.IDE0290.severity = none # Use primary constructor
411-
dotnet_diagnostic.CS1591.severity = none # Missing XML comment for publicly visible type or member
412-
# 15000+ warnings in the solution
413-
dotnet_diagnostic.CA1510.severity = none # Use ArgumentNullException throw helper
414-
# doesn't work with older versions of .NET
415-

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github: [lepoco]
1+
github: [pomianowski]

.github/workflows/i18n-cd-nuget.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ jobs:
1717
- uses: nuget/setup-nuget@v2
1818
with:
1919
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
20-
- name: Setup .NET Core SDK 8.x
20+
- name: Setup .NET Core SDK 10.x
2121
uses: actions/setup-dotnet@v4
2222
with:
23-
dotnet-version: 8.x
23+
dotnet-version: 10.x
2424

2525
- name: Install dependencies
2626
run: dotnet restore
2727

2828
- name: Build
29-
run: dotnet build Lepo.i18n.sln --configuration Release --no-restore -p:SourceLinkEnabled=true
29+
run: dotnet build Lepo.i18n.slnx --configuration Release --no-restore -p:SourceLinkEnabled=true
3030

3131
- name: Run tests
32-
run: dotnet test Lepo.i18n.sln --configuration Release --no-restore --no-build --verbosity quiet
32+
run: dotnet test Lepo.i18n.slnx --configuration Release --no-restore --no-build --verbosity quiet
3333

3434
- name: Publish the package to NuGet.org
3535
run: nuget push **\*.nupkg -NonInteractive -SkipDuplicate -Source 'https://api.nuget.org/v3/index.json'

.github/workflows/i18n-pr-validator.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ jobs:
2020
with:
2121
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
2222

23-
- name: Setup .NET Core SDK 8.x
23+
- name: Setup .NET Core SDK 10.x
2424
uses: actions/setup-dotnet@v4
2525
with:
26-
dotnet-version: 8.x
26+
dotnet-version: 10.x
2727

2828
- name: Install dependencies
2929
run: dotnet restore
3030

3131
- name: Build
32-
run: dotnet build Lepo.i18n.sln --configuration Release --no-restore
32+
run: dotnet build Lepo.i18n.slnx --configuration Release --no-restore
3333

3434
- name: Run tests
35-
run: dotnet test Lepo.i18n.sln --configuration Release --no-restore --no-build --verbosity quiet
35+
run: dotnet test Lepo.i18n.slnx --configuration Release --no-restore --no-build --verbosity quiet

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"workbench.colorCustomizations": {
3+
"editorWhitespace.foreground": "#5a5a5a"
4+
}
5+
}

Directory.Build.props

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
<Project>
2-
32
<PropertyGroup>
4-
<RepositoryDirectory>$(MSBuildThisFileDirectory)</RepositoryDirectory>
5-
<BuildToolsDirectory>$(RepositoryDirectory)build\</BuildToolsDirectory>
6-
</PropertyGroup>
7-
8-
<PropertyGroup>
9-
<Version>2.0.0</Version>
3+
<Version>2.1.0</Version>
4+
<AssemblyVersion>2.1.0</AssemblyVersion>
105
</PropertyGroup>
116

127
<PropertyGroup>
138
<Company>lepo.co</Company>
149
<Authors>lepo.co</Authors>
1510
<Product>Lepo.i18n</Product>
16-
<CommonTags>lepoco;toolkit;translation;wpf;winforms;i18n;localization;cli</CommonTags>
11+
<CommonTags>lepoco;i18n;toolkit;translation;wpf;winforms;i18n;localization;cli;winforms;json;resources;yaml;graphical</CommonTags>
1712
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1813
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
1914
<Copyright>(c) lepo.co | Leszek Pomianowski and Contributors. All rights reserved.</Copyright>
@@ -23,21 +18,15 @@
2318
<PackageIconUrl>https://github.com/lepoco/i18n/main/build/nuget.png</PackageIconUrl>
2419
</PropertyGroup>
2520

26-
<PropertyGroup>
27-
<NuGetAudit>true</NuGetAudit>
28-
<NuGetAuditLevel>moderate</NuGetAuditLevel>
29-
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
30-
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
31-
</PropertyGroup>
32-
3321
<PropertyGroup>
3422
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
3523
</PropertyGroup>
3624

3725
<PropertyGroup>
3826
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
39-
<LangVersion>12.0</LangVersion>
27+
<LangVersion>14.0</LangVersion>
4028
<Nullable>enable</Nullable>
29+
<ImplicitUsings>enable</ImplicitUsings>
4130

4231
<!--
4332
Suppress ref safety warnings in unsafe contexts (see https://github.com/dotnet/csharplang/issues/6476).
@@ -47,10 +36,29 @@
4736
<NoWarn>$(NoWarn);CS8500</NoWarn>
4837
</PropertyGroup>
4938

39+
<PropertyGroup>
40+
<RepositoryDirectory>$(MSBuildThisFileDirectory)</RepositoryDirectory>
41+
<BuildToolsDirectory>$(RepositoryDirectory)build\</BuildToolsDirectory>
42+
</PropertyGroup>
43+
5044
<PropertyGroup>
5145
<IsTestProject>$(MSBuildProjectName.Contains('Test'))</IsTestProject>
5246
<IsCoreProject Condition="$(IsTestProject)">False</IsCoreProject>
5347
<IsCoreProject Condition="'$(IsCoreProject)' == ''">True</IsCoreProject>
48+
<IsBelowNet8
49+
Condition="'$(TargetFramework)' == 'netstandard2.0'
50+
Or '$(TargetFramework)' == 'netstandard2.1'
51+
Or '$(TargetFramework)' == 'net462'
52+
Or '$(TargetFramework)' == 'net472'
53+
Or '$(TargetFramework)' == 'net481'
54+
Or '$(TargetFramework)' == 'net5.0'
55+
Or '$(TargetFramework)' == 'net6.0'
56+
Or '$(TargetFramework)' == 'net7.0'
57+
Or '$(TargetFramework)' == 'net8.0'
58+
Or '$(TargetFramework)' == 'net9.0'
59+
Or '$(TargetFramework)' == 'net10.0'"
60+
>True</IsBelowNet8
61+
>
5462
</PropertyGroup>
5563

5664
<PropertyGroup>
@@ -59,6 +67,10 @@
5967
<ContinuousIntegrationBuild>$(TF_BUILD)</ContinuousIntegrationBuild>
6068
</PropertyGroup>
6169

70+
<PropertyGroup Condition="'$(IsBelowNet8)' == 'false'">
71+
<DefineConstants>$(DefineConstants);NET8_0_OR_GREATER</DefineConstants>
72+
</PropertyGroup>
73+
6274
<Choose>
6375
<When Condition="$(IsCoreProject)">
6476
<PropertyGroup>
@@ -75,14 +87,6 @@
7587
</Otherwise>
7688
</Choose>
7789

78-
<!-- Include PolySharp to generate polyfills for all projects (on their .NET Standard 2.x targets) -->
79-
<ItemGroup>
80-
<PackageReference Include="PolySharp">
81-
<PrivateAssets>all</PrivateAssets>
82-
<IncludeAssets>build; analyzers</IncludeAssets>
83-
</PackageReference>
84-
</ItemGroup>
85-
8690
<Choose>
8791
<When Condition="'$(SourceLinkEnabled)' != 'false'">
8892
<PropertyGroup>
@@ -98,5 +102,4 @@
98102
</ItemGroup>
99103
</When>
100104
</Choose>
101-
102105
</Project>

Directory.Build.targets

Lines changed: 68 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<Project>
2-
32
<PropertyGroup>
43
<!-- TODO: Dynamically generate Title if one wasn't set -->
54
<Title Condition="'$(Title)' == ''">$(Product) Asset</Title>
@@ -12,15 +11,61 @@
1211
</PropertyGroup>
1312

1413
<ItemGroup Condition="$(IsPackable)">
15-
<None Include="$(BuildToolsDirectory)nuget.png" Pack="true" PackagePath="\Icon.png" Visible="False" />
16-
<None Include="$(RepositoryDirectory)ThirdPartyNotices.txt" Pack="true" PackagePath="\" Visible="False" />
17-
<None Include="$(RepositoryDirectory)LICENSE.md" Pack="true" PackagePath="\LICENSE.md" Visible="False" />
18-
<None Include="$(RepositoryDirectory)README.md" Pack="true" PackagePath="\README.md" Visible="False" />
14+
<None
15+
Include="$(BuildToolsDirectory)nuget.png"
16+
Pack="true"
17+
PackagePath="\Icon.png"
18+
Visible="False"
19+
/>
20+
<None
21+
Include="$(RepositoryDirectory)ThirdPartyNotices.txt"
22+
Pack="true"
23+
PackagePath="\"
24+
Visible="False"
25+
/>
26+
<None
27+
Include="$(RepositoryDirectory)LICENSE.md"
28+
Pack="true"
29+
PackagePath="\LICENSE.md"
30+
Visible="False"
31+
/>
32+
<None
33+
Include="$(RepositoryDirectory)README.md"
34+
Pack="true"
35+
PackagePath="\README.md"
36+
Visible="False"
37+
/>
38+
</ItemGroup>
39+
40+
<ItemGroup Condition="'$(MSBuildProjectExtension)' != '.dcproj' and '$(MSBuildProjectExtension)' != '.sfproj' and '$(VisualStudioTemplateProject)' != 'true' and '$(VisualStudioExtensionProject)' != 'true'">
41+
<PackageReference Include="PolySharp" Condition="'$(TargetFramework)' == 'netstandard2.1'">
42+
<PrivateAssets>all</PrivateAssets>
43+
<IncludeAssets>build; analyzers</IncludeAssets>
44+
</PackageReference>
45+
<PackageReference Include="PolySharp" Condition="'$(TargetFramework)' == 'netstandard2.0'">
46+
<PrivateAssets>all</PrivateAssets>
47+
<IncludeAssets>build; analyzers</IncludeAssets>
48+
</PackageReference>
49+
<PackageReference Include="PolySharp" Condition="'$(TargetFramework)' == 'net481'">
50+
<PrivateAssets>all</PrivateAssets>
51+
<IncludeAssets>build; analyzers</IncludeAssets>
52+
</PackageReference>
53+
<PackageReference Include="PolySharp" Condition="'$(TargetFramework)' == 'net472'">
54+
<PrivateAssets>all</PrivateAssets>
55+
<IncludeAssets>build; analyzers</IncludeAssets>
56+
</PackageReference>
57+
<PackageReference Include="PolySharp" Condition="'$(TargetFramework)' == 'net462'">
58+
<PrivateAssets>all</PrivateAssets>
59+
<IncludeAssets>build; analyzers</IncludeAssets>
60+
</PackageReference>
1961
</ItemGroup>
2062

2163
<Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
2264
<ItemGroup>
23-
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(SourceRevisionId)' != ''">
65+
<AssemblyAttribute
66+
Include="System.Reflection.AssemblyMetadataAttribute"
67+
Condition="'$(SourceRevisionId)' != ''"
68+
>
2469
<_Parameter1>CommitHash</_Parameter1>
2570
<_Parameter2>$(SourceRevisionId)</_Parameter2>
2671
</AssemblyAttribute>
@@ -49,7 +94,9 @@
4994
performance benefits, depending on the workload.
5095
-->
5196
<PropertyGroup>
52-
<GeneratedSkipLocalsInitFile Condition="'$(GeneratedSkipLocalsInitFile)' == ''">$(IntermediateOutputPath)$(MSBuildProjectName).SkipLocalsInit.g.cs</GeneratedSkipLocalsInitFile>
97+
<GeneratedSkipLocalsInitFile Condition="'$(GeneratedSkipLocalsInitFile)' == ''"
98+
>$(IntermediateOutputPath)$(MSBuildProjectName).SkipLocalsInit.g.cs</GeneratedSkipLocalsInitFile
99+
>
53100
<GeneratedSkipLocalsInitFileLines>
54101
<![CDATA[//------------------------------------------------------------------------------
55102
// <auto-generated>
@@ -64,15 +111,21 @@
64111
</GeneratedSkipLocalsInitFileLines>
65112
</PropertyGroup>
66113

67-
<Target Name="GenerateSkipLocalsInit"
68-
BeforeTargets="BeforeCompile;CoreCompile"
69-
DependsOnTargets="PrepareForBuild"
70-
Condition="'$(Language)' == 'C#'"
71-
Inputs="$(MSBuildAllProjects)"
72-
Outputs="$(GeneratedSkipLocalsInitFile)">
73-
114+
<Target
115+
Name="GenerateSkipLocalsInit"
116+
BeforeTargets="BeforeCompile;CoreCompile"
117+
DependsOnTargets="PrepareForBuild"
118+
Condition="'$(Language)' == 'C#'"
119+
Inputs="$(MSBuildAllProjects)"
120+
Outputs="$(GeneratedSkipLocalsInitFile)"
121+
>
74122
<!-- Write the file with the attribute -->
75-
<WriteLinesToFile Lines="$(GeneratedSkipLocalsInitFileLines)" Overwrite="true" WriteOnlyWhenDifferent="true" File="$(GeneratedSkipLocalsInitFile)" />
123+
<WriteLinesToFile
124+
Lines="$(GeneratedSkipLocalsInitFileLines)"
125+
Overwrite="true"
126+
WriteOnlyWhenDifferent="true"
127+
File="$(GeneratedSkipLocalsInitFile)"
128+
/>
76129

77130
<!-- Include the generated file in the list of files to compile -->
78131
<ItemGroup>

Directory.Packages.props

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
<Project>
22
<ItemGroup>
3-
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.2.2" />
4-
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
5-
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
6-
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
7-
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
8-
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
3+
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0" />
4+
<PackageVersion Include="coverlet.collector" Version="8.0.0" />
5+
<PackageVersion Include="AwesomeAssertions" Version="9.4.0" />
6+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.0" />
7+
<PackageVersion
8+
Include="Microsoft.Extensions.DependencyInjection.Abstractions"
9+
Version="6.0.0"
10+
/>
11+
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.0" />
912
<PackageVersion Include="Microsoft.Extensions.Localization.Abstractions" Version="6.0.0" />
10-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
11-
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
12-
<PackageVersion Include="NSubstitute" Version="5.1.0" />
13-
<PackageVersion Include="System.Text.Json" Version="6.0.0" />
14-
<PackageVersion Include="PolySharp" Version="1.13.1" />
13+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
14+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="10.0.103" />
15+
<PackageVersion Include="NSubstitute" Version="5.3.0" />
16+
<PackageVersion Include="System.Text.Json" Version="10.0.3" />
17+
<PackageVersion Include="PolySharp" Version="1.15.0" />
1518
<PackageVersion Include="xunit.extensibility.core" Version="2.6.2" />
1619
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.4" />
1720
<PackageVersion Include="xunit" Version="2.6.2" />
1821
</ItemGroup>
19-
</Project>
22+
</Project>

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022-2024 Leszek Pomianowski and Lepo.i18n Contributors. https://dev.lepo.co/
3+
Copyright (c) 2022-2026 Leszek Pomianowski and Lepo.i18n Contributors. <https://dev.lepo.co/>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Leszek Pomianowski and Lepo.i18n Contributors. https://dev.lepo.co/
3+
Copyright (c) 2022-2026 Leszek Pomianowski and Lepo.i18n Contributors. <https://dev.lepo.co/>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)