Skip to content

Commit 89e4a5b

Browse files
committed
NuGet governance remediation for PanoramicData.SheetMagic
1 parent 779e164 commit 89e4a5b

15 files changed

Lines changed: 339 additions & 331 deletions

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
root = true
2+
13
# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
24

35
[*]
@@ -79,3 +81,4 @@ dotnet_style_qualification_for_field = false:suggestion
7981
dotnet_style_qualification_for_method = false:suggestion
8082
#prefer properties not to be prefaced with this. or Me. in Visual Basic
8183
dotnet_style_qualification_for_property = false:suggestion
84+
csharp_style_namespace_declarations = file_scoped:error

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "nuget"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"
12+
open-pull-requests-limit: 5

.github/workflows/ci.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags: ['[0-9]*.[0-9]*.[0-9]*']
7+
pull_request:
8+
branches: [main]
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Setup .NET
20+
uses: actions/setup-dotnet@v4
21+
with:
22+
dotnet-version: 10.0.x
23+
24+
- name: Restore
25+
run: dotnet restore
26+
27+
- name: Build
28+
run: dotnet build --configuration Release --no-restore
29+
30+
- name: Test
31+
run: dotnet test --configuration Release --no-build --verbosity normal
32+
33+
- name: Pack
34+
run: dotnet pack --configuration Release --no-build --output ./artifacts
35+
36+
- name: Upload artifacts
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: packages
40+
path: ./artifacts/*.nupkg
41+
42+
publish:
43+
needs: build
44+
runs-on: ubuntu-latest
45+
if: startsWith(github.ref, 'refs/tags/')
46+
permissions:
47+
id-token: write
48+
steps:
49+
- name: Download artifacts
50+
uses: actions/download-artifact@v4
51+
with:
52+
name: packages
53+
path: ./artifacts
54+
55+
- name: Setup .NET
56+
uses: actions/setup-dotnet@v4
57+
with:
58+
dotnet-version: 10.0.x
59+
60+
- name: Login to NuGet
61+
id: login
62+
uses: NuGet/login@v1
63+
with:
64+
nuget-server-url: https://api.nuget.org/v3/index.json
65+
66+
- name: Push to NuGet
67+
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

CONTRIBUTING.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Contributing
2+
3+
Thank you for your interest in contributing to this project!
4+
5+
## How to Contribute
6+
7+
1. **Fork** the repository
8+
2. **Create a branch** for your feature or fix (`git checkout -b feature/my-feature`)
9+
3. **Make your changes** following the coding standards below
10+
4. **Write or update tests** as appropriate
11+
5. **Ensure the build passes** with zero errors, zero warnings, and zero messages
12+
6. **Submit a Pull Request** against the `main` branch
13+
14+
## Coding Standards
15+
16+
- All public members must have XML documentation comments
17+
- Use `System.Text.Json` — do not introduce `Newtonsoft.Json`
18+
- Use Refit for HTTP client interfaces
19+
- Use file-scoped namespaces
20+
- Use the `required` keyword for DTO properties where appropriate
21+
- Ensure `TreatWarningsAsErrors` remains enabled
22+
- All code must compile with zero diagnostics
23+
24+
## Testing
25+
26+
- Use xUnit v3 for all tests
27+
- Use AwesomeAssertions for fluent assertions
28+
- Ensure all existing tests pass before submitting a PR
29+
30+
## License
31+
32+
By contributing, you agree that your contributions will be licensed under the MIT License.

Directory.Build.props

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project>
3+
<PropertyGroup>
4+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
5+
<Nullable>enable</Nullable>
6+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
7+
<Copyright>Copyright © Panoramic Data Limited</Copyright>
8+
<Authors>Panoramic Data Limited</Authors>
9+
<Company>Panoramic Data Limited</Company>
10+
<NuGetAuditMode>All</NuGetAuditMode>
11+
</PropertyGroup>
12+
</Project>

Directory.Packages.props

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project>
3+
<PropertyGroup>
4+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<PackageVersion Include="AwesomeAssertions" Version="9.3.0" />
8+
<PackageVersion Include="AwesomeAssertions.Analyzers" Version="9.0.8" />
9+
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
10+
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
11+
<PackageVersion Include="DocumentFormat.OpenXml" Version="[2.20.0,3.0.0)" />
12+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
13+
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.9.50" />
14+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
15+
<PackageVersion Include="xunit.v3" Version="3.2.1" />
16+
</ItemGroup>
17+
</Project>
Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<Project Sdk="Microsoft.NET.Sdk">
2-
3-
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<TargetFramework>net10.0</TargetFramework>
6-
<ImplicitUsings>enable</ImplicitUsings>
7-
<Nullable>enable</Nullable>
8-
<LangVersion>latest</LangVersion>
9-
</PropertyGroup>
10-
11-
<ItemGroup>
12-
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
13-
</ItemGroup>
14-
15-
<ItemGroup>
16-
<ProjectReference Include="..\PanoramicData.SheetMagic\PanoramicData.SheetMagic.csproj" />
17-
</ItemGroup>
18-
19-
</Project>
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net10.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<LangVersion>latest</LangVersion>
9+
<NoWarn>CS1591</NoWarn>
10+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
11+
<PackageId>PanoramicData.SheetMagic.Benchmarks</PackageId>
12+
<RepositoryUrl>https://github.com/panoramicdata/PanoramicData.SheetMagic</RepositoryUrl>
13+
<IncludeSymbols>true</IncludeSymbols>
14+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
15+
<NeutralResourcesLanguage>en</NeutralResourcesLanguage>
16+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
17+
<PackageReadmeFile>README.md</PackageReadmeFile>
18+
</PropertyGroup>
19+
<ItemGroup>
20+
<None Include="..\README.md" Pack="true" PackagePath="\" />
21+
</ItemGroup>
22+
<ItemGroup>
23+
<PackageReference Include="BenchmarkDotNet" />
24+
</ItemGroup>
25+
<ItemGroup>
26+
<ProjectReference Include="..\PanoramicData.SheetMagic\PanoramicData.SheetMagic.csproj" />
27+
</ItemGroup>
28+
</Project>
Lines changed: 64 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,64 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
2-
3-
<PropertyGroup>
4-
<TargetFramework>net10.0</TargetFramework>
5-
<LangVersion>latest</LangVersion>
6-
<Nullable>enable</Nullable>
7-
<IsPackable>false</IsPackable>
8-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
9-
</PropertyGroup>
10-
11-
<ItemGroup>
12-
<None Remove="LookingPoint-Pathways-Devices.xlsx" />
13-
<None Remove="ParentChild.xlsx" />
14-
<None Remove="Sheets\LMREP-7413.xlsx" />
15-
<None Remove="Sheets\UAE_Broken.xlsx" />
16-
</ItemGroup>
17-
18-
<ItemGroup>
19-
<Content Include="Sheets\LMREP-7413.xlsx">
20-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
21-
</Content>
22-
<Content Include="Sheets\UAE_Broken.xlsx">
23-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
24-
</Content>
25-
</ItemGroup>
26-
27-
<ItemGroup>
28-
<PackageReference Include="AwesomeAssertions" Version="9.3.0" />
29-
<PackageReference Include="AwesomeAssertions.Analyzers" Version="9.0.8">
30-
<PrivateAssets>all</PrivateAssets>
31-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
32-
</PackageReference>
33-
<PackageReference Include="coverlet.collector" Version="6.0.4">
34-
<PrivateAssets>all</PrivateAssets>
35-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
36-
</PackageReference>
37-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
38-
<PackageReference Include="Nerdbank.GitVersioning" Version="3.9.50">
39-
<PrivateAssets>all</PrivateAssets>
40-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
41-
</PackageReference>
42-
<PackageReference Include="xunit.v3" Version="3.2.1" />
43-
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
44-
<PrivateAssets>all</PrivateAssets>
45-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
46-
</PackageReference>
47-
</ItemGroup>
48-
49-
<ItemGroup>
50-
<ProjectReference Include="..\PanoramicData.SheetMagic\PanoramicData.SheetMagic.csproj" />
51-
</ItemGroup>
52-
53-
<ItemGroup>
54-
<None Update="Sheets\Bulk Import Template.xlsx">
55-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
56-
</None>
57-
<None Update="Sheets\LookingPoint-Pathways-Devices.xlsx">
58-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
59-
</None>
60-
<None Update="Sheets\EnumTest.xlsx">
61-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
62-
</None>
63-
<None Update="Sheets\ParentChild.xlsx">
64-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
65-
</None>
66-
</ItemGroup>
67-
68-
</Project>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project Sdk="Microsoft.NET.Sdk">
3+
<PropertyGroup>
4+
<TargetFramework>net10.0</TargetFramework>
5+
<LangVersion>latest</LangVersion>
6+
<Nullable>enable</Nullable>
7+
<IsPackable>false</IsPackable>
8+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
9+
<NoWarn>CS1591</NoWarn>
10+
<ImplicitUsings>enable</ImplicitUsings>
11+
</PropertyGroup>
12+
<ItemGroup>
13+
<None Remove="LookingPoint-Pathways-Devices.xlsx" />
14+
<None Remove="ParentChild.xlsx" />
15+
<None Remove="Sheets\LMREP-7413.xlsx" />
16+
<None Remove="Sheets\UAE_Broken.xlsx" />
17+
</ItemGroup>
18+
<ItemGroup>
19+
<Content Include="Sheets\LMREP-7413.xlsx">
20+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
21+
</Content>
22+
<Content Include="Sheets\UAE_Broken.xlsx">
23+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
24+
</Content>
25+
</ItemGroup>
26+
<ItemGroup>
27+
<PackageReference Include="AwesomeAssertions" />
28+
<PackageReference Include="AwesomeAssertions.Analyzers">
29+
<PrivateAssets>all</PrivateAssets>
30+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
31+
</PackageReference>
32+
<PackageReference Include="coverlet.collector">
33+
<PrivateAssets>all</PrivateAssets>
34+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
35+
</PackageReference>
36+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
37+
<PackageReference Include="Nerdbank.GitVersioning">
38+
<PrivateAssets>all</PrivateAssets>
39+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
40+
</PackageReference>
41+
<PackageReference Include="xunit.v3" />
42+
<PackageReference Include="xunit.runner.visualstudio">
43+
<PrivateAssets>all</PrivateAssets>
44+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
45+
</PackageReference>
46+
</ItemGroup>
47+
<ItemGroup>
48+
<ProjectReference Include="..\PanoramicData.SheetMagic\PanoramicData.SheetMagic.csproj" />
49+
</ItemGroup>
50+
<ItemGroup>
51+
<None Update="Sheets\Bulk Import Template.xlsx">
52+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
53+
</None>
54+
<None Update="Sheets\LookingPoint-Pathways-Devices.xlsx">
55+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
56+
</None>
57+
<None Update="Sheets\EnumTest.xlsx">
58+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
59+
</None>
60+
<None Update="Sheets\ParentChild.xlsx">
61+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
62+
</None>
63+
</ItemGroup>
64+
</Project>

PanoramicData.SheetMagic.slnx

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<Solution>
2-
<Folder Name="/Solution Items/">
3-
<File Path=".editorconfig" />
4-
<File Path=".gitignore" />
5-
<File Path="global.json" />
6-
<File Path="LICENSE" />
7-
<File Path="nuget-key.txt" />
8-
<File Path="Publish.ps1" />
9-
<File Path="PUBLISHING.md" />
10-
<File Path="README.md" />
11-
<File Path="SheetMagic.png" />
12-
<File Path="version.json" />
13-
</Folder>
14-
<Project Path="PanoramicData.SheetMagic.Benchmarks/PanoramicData.SheetMagic.Benchmarks.csproj" />
15-
<Project Path="PanoramicData.SheetMagic.Test/PanoramicData.SheetMagic.Test.csproj" />
16-
<Project Path="PanoramicData.SheetMagic/PanoramicData.SheetMagic.csproj" />
17-
</Solution>
3+
<Folder Name="/Solution Items/">
4+
<File Path=".editorconfig" />
5+
<File Path=".gitignore" />
6+
<File Path="global.json" />
7+
<File Path="LICENSE" />
8+
<File Path="nuget-key.txt" />
9+
<File Path="Publish.ps1" />
10+
<File Path="PUBLISHING.md" />
11+
<File Path="README.md" />
12+
<File Path="SheetMagic.png" />
13+
<File Path="version.json" />
14+
<File Path="SECURITY.md" />
15+
<File Path="CONTRIBUTING.md" />
16+
<File Path="Directory.Build.props" />
17+
<File Path="Directory.Packages.props" />
18+
</Folder>
19+
<Project Path="PanoramicData.SheetMagic.Benchmarks/PanoramicData.SheetMagic.Benchmarks.csproj" />
20+
<Project Path="PanoramicData.SheetMagic.Test/PanoramicData.SheetMagic.Test.csproj" />
21+
<Project Path="PanoramicData.SheetMagic/PanoramicData.SheetMagic.csproj" />
22+
</Solution>

PanoramicData.SheetMagic/MagicSpreadsheet.CellFormatting.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,14 @@ out var number
3737
// Return the date - we have to replace lower-case 'm' with upper-case as
3838
// required by C# else we get minutes
3939
// Some custom formats used by customers also have @ and ; in them.
40+
// Use InvariantCulture so the '/' date separator is always a literal slash.
4041
return actualDate.Value.ToString(
4142
formatString
4243
.Replace("\\", string.Empty)
4344
.Replace(";", string.Empty)
4445
.Replace("@", string.Empty)
45-
.Replace("m", "M"))
46+
.Replace("m", "M"),
47+
System.Globalization.CultureInfo.InvariantCulture)
4648
.Trim();
4749
}
4850

0 commit comments

Comments
 (0)