Skip to content

Restructure project layout to more modern form - #36

Open
rheone wants to merge 10 commits into
mainfrom
preludeTov3
Open

Restructure project layout to more modern form#36
rheone wants to merge 10 commits into
mainfrom
preludeTov3

Conversation

@rheone

@rheone rheone commented Jul 5, 2026

Copy link
Copy Markdown
Member
  • Migrate from .sln to .slnx solution format, placed at repo root
  • Move config files (global.json, .csharpierrc.json, stylecop.json) from src/ to repo root
  • Replace src/.editorconfig with expanded root .editorconfig
  • Add MSBuild infrastructure: Directory.Build.props, Directory.Build.targets, Directory.Packages.props (Central Package Management)
  • Add smoketests/ directory with test project, run scripts (.sh/.ps1), and README
  • Add CI/CD workflows: CodeQL, dependency review, Scorecard, smoke tests
  • Add community/security files: CONTRIBUTING.md, SECURITY.md, .pre-commit-config.yaml
  • Add benchmark run scripts (src/run-benchmarks.sh, src/run-benchmarks.ps1)
  • Add test config (src/.runsettings)
  • Update .gitignore, .gitattributes, .config/dotnet-tools.json, Husky hooks
  • Update .csproj files and packages.lock.json for main project and tests

- Migrate from .sln to .slnx solution format, placed at repo root
- Move config files (global.json, .csharpierrc.json, stylecop.json) from src/ to repo root
- Replace src/.editorconfig with expanded root .editorconfig
- Add MSBuild infrastructure: Directory.Build.props, Directory.Build.targets, Directory.Packages.props (Central Package Management)
- Add smoketests/ directory with test project, run scripts (.sh/.ps1), and README
- Add CI/CD workflows: CodeQL, dependency review, Scorecard, smoke tests
- Add community/security files: CONTRIBUTING.md, SECURITY.md, .pre-commit-config.yaml
- Add benchmark run scripts (src/run-benchmarks.sh, src/run-benchmarks.ps1)
- Add test config (src/.runsettings)
- Update .gitignore, .gitattributes, .config/dotnet-tools.json, Husky hooks
- Update .csproj files and packages.lock.json for main project and tests
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 30 package(s) with unknown licenses.
See the Details below.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA e013b1f.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

License Issues

.github/workflows/scorecard.yml

PackageVersionLicenseIssue Type
actions/checkout6.*.*NullUnknown License
actions/upload-artifact4.*.*NullUnknown License
github/codeql-action/upload-sarif4.*.*NullUnknown License
ossf/scorecard-action2.*.*NullUnknown License

.github/workflows/smoke-test.yml

PackageVersionLicenseIssue Type
actions/cache4.*.*NullUnknown License
actions/checkout6.*.*NullUnknown License
actions/setup-dotnet5.*.*NullUnknown License

smoketests/SmokeTests/SmokeTests.csproj

PackageVersionLicenseIssue Type
NetDuidNullUnknown License

src/NetDuid.Benchmarks/NetDuid.Benchmarks.csproj

PackageVersionLicenseIssue Type
BenchmarkDotNet>= 0NullUnknown License
Microsoft.NETFramework.ReferenceAssemblies>= 0NullUnknown License

src/NetDuid.Tests/NetDuid.Tests.csproj

PackageVersionLicenseIssue Type
Microsoft.NET.Test.Sdk>= 0NullUnknown License
Microsoft.NETFramework.ReferenceAssemblies>= 0NullUnknown License
NSubstitute>= 0NullUnknown License
NSubstitute.Analyzers.CSharp>= 0NullUnknown License
Roslynator.Analyzers>= 0NullUnknown License
Roslynator.CodeAnalysis.Analyzers>= 0NullUnknown License
Roslynator.Formatting.Analyzers>= 0NullUnknown License
SonarAnalyzer.CSharp>= 0NullUnknown License
StyleCop.Analyzers>= 0NullUnknown License
xunit.analyzers>= 0NullUnknown License
xunit.runner.visualstudio>= 0NullUnknown License
xunit.v3>= 0NullUnknown License

src/NetDuid/NetDuid.csproj

PackageVersionLicenseIssue Type
Microsoft.Bcl.HashCode>= 0NullUnknown License
Microsoft.Bcl.Memory>= 0NullUnknown License
Microsoft.SourceLink.GitHub>= 0NullUnknown License
Roslynator.Analyzers>= 0NullUnknown License
Roslynator.CodeAnalysis.Analyzers>= 0NullUnknown License
Roslynator.Formatting.Analyzers>= 0NullUnknown License
SonarAnalyzer.CSharp>= 0NullUnknown License
StyleCop.Analyzers>= 0NullUnknown License

OpenSSF Scorecard

Scorecard details
PackageVersionScoreDetails
actions/actions/checkout 6.*.* 🟢 7
Details
CheckScoreReason
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Code-Review🟢 10all changesets reviewed
Maintained🟢 1018 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Binary-Artifacts🟢 10no binaries found in the repo
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Packaging⚠️ -1packaging workflow not detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Pinned-Dependencies🟢 3dependency not pinned by hash detected -- score normalized to 3
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
SAST🟢 10SAST tool is run on all commits
Branch-Protection🟢 6branch protection is not maximal on development and all release branches
actions/actions/upload-artifact 4.*.* 🟢 5.5
Details
CheckScoreReason
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Code-Review🟢 10all changesets reviewed
Maintained🟢 34 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Packaging⚠️ -1packaging workflow not detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies⚠️ 1dependency not pinned by hash detected -- score normalized to 1
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
SAST🟢 10SAST tool is run on all commits
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
actions/github/codeql-action/upload-sarif 4.*.* UnknownUnknown
actions/ossf/scorecard-action 2.*.* 🟢 9.1
Details
CheckScoreReason
Dependency-Update-Tool🟢 10update tool detected
Security-Policy🟢 10security policy file detected
Maintained🟢 1017 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Binary-Artifacts🟢 10no binaries found in the repo
Code-Review🟢 10all changesets reviewed
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
Pinned-Dependencies🟢 9dependency not pinned by hash detected -- score normalized to 9
License🟢 10license file detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Signed-Releases⚠️ -1no releases found
Packaging🟢 10packaging workflow detected
Vulnerabilities🟢 100 existing vulnerabilities detected
SAST🟢 10SAST tool is run on all commits
Fuzzing⚠️ 0project is not fuzzed
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
CI-Tests🟢 1030 out of 30 merged PRs checked by a CI test -- score normalized to 10
Contributors🟢 10project has 16 contributing companies or organizations
actions/actions/cache 4.*.* 🟢 6.4
Details
CheckScoreReason
Maintained🟢 1016 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Packaging⚠️ -1packaging workflow not detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Code-Review🟢 10all changesets reviewed
Binary-Artifacts🟢 10no binaries found in the repo
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies🟢 3dependency not pinned by hash detected -- score normalized to 3
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
SAST🟢 10SAST tool is run on all commits
Branch-Protection⚠️ 1branch protection is not maximal on development and all release branches
actions/actions/checkout 6.*.* 🟢 7
Details
CheckScoreReason
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Code-Review🟢 10all changesets reviewed
Maintained🟢 1018 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Binary-Artifacts🟢 10no binaries found in the repo
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Packaging⚠️ -1packaging workflow not detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Pinned-Dependencies🟢 3dependency not pinned by hash detected -- score normalized to 3
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
SAST🟢 10SAST tool is run on all commits
Branch-Protection🟢 6branch protection is not maximal on development and all release branches
actions/actions/setup-dotnet 5.*.* 🟢 6.6
Details
CheckScoreReason
Maintained🟢 1012 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 10all changesets reviewed
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
SAST🟢 9SAST tool is not run on all commits -- score normalized to 9
nuget/NetDuid UnknownUnknown
nuget/BenchmarkDotNet >= 0 UnknownUnknown
nuget/Microsoft.NETFramework.ReferenceAssemblies >= 0 UnknownUnknown
nuget/Microsoft.NET.Test.Sdk >= 0 UnknownUnknown
nuget/Microsoft.NETFramework.ReferenceAssemblies >= 0 UnknownUnknown
nuget/NSubstitute >= 0 UnknownUnknown
nuget/NSubstitute.Analyzers.CSharp >= 0 UnknownUnknown
nuget/Roslynator.Analyzers >= 0 UnknownUnknown
nuget/Roslynator.CodeAnalysis.Analyzers >= 0 UnknownUnknown
nuget/Roslynator.Formatting.Analyzers >= 0 UnknownUnknown
nuget/SonarAnalyzer.CSharp >= 0 UnknownUnknown
nuget/StyleCop.Analyzers >= 0 UnknownUnknown
nuget/xunit.analyzers >= 0 UnknownUnknown
nuget/xunit.runner.visualstudio >= 0 UnknownUnknown
nuget/xunit.v3 >= 0 UnknownUnknown
nuget/Microsoft.Bcl.HashCode >= 0 UnknownUnknown
nuget/Microsoft.Bcl.Memory >= 0 UnknownUnknown
nuget/Microsoft.SourceLink.GitHub >= 0 UnknownUnknown
nuget/Roslynator.Analyzers >= 0 UnknownUnknown
nuget/Roslynator.CodeAnalysis.Analyzers >= 0 UnknownUnknown
nuget/Roslynator.Formatting.Analyzers >= 0 UnknownUnknown
nuget/SonarAnalyzer.CSharp >= 0 UnknownUnknown
nuget/StyleCop.Analyzers >= 0 UnknownUnknown

Scanned Files

  • .github/workflows/scorecard.yml
  • .github/workflows/smoke-test.yml
  • smoketests/SmokeTests/SmokeTests.csproj
  • src/NetDuid.Benchmarks/NetDuid.Benchmarks.csproj
  • src/NetDuid.Tests/NetDuid.Tests.csproj
  • src/NetDuid/NetDuid.csproj

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

Summary

Generated on: 07/10/2026 - 21:26:12
Parser: MultiReport (3x Cobertura)
Assemblies: 2
Classes: 9
Files: 21
Line coverage: 95.4% (1186 of 1243)
Covered lines: 1186
Uncovered lines: 57
Coverable lines: 1243
Total lines: 3569
Branch coverage: 90.7% (518 of 571)
Covered branches: 518
Total branches: 571
Method coverage: Feature is only available for sponsors
Tag: 91_29124568955

Risk Hotspots

Assembly Class Method Crap Score Cyclomatic complexity
NetDuid System.Text.RegularExpressions.Generated TryMatchAtCurrentPosition(...) 55 54

Coverage

Name Covered Uncovered Coverable Total Line coverage Covered Total Branch coverage
NetDuid 733 45 778 2698 94.2% 423 465 90.9%
NetDuid.Duid 177 21 198 909 89.3% 147 159 92.4%
NetDuid.DuidRegexPatterns 4 0 4 51 100% 0 0
System.Text.RegularExpressions.Generated 184 8 192 580 95.8% 92 102 90.1%
System.Text.RegularExpressions.Generated 184 8 192 580 95.8% 92 102 90.1%
System.Text.RegularExpressions.Generated 184 8 192 578 95.8% 92 102 90.1%
NetDuid.Tests 453 12 465 1451 97.4% 95 106 89.6%
NetDuid.Tests.DuidTests 400 0 400 1193 100% 73 74 98.6%
NetDuid.Tests.DuidTypeTests 29 1 30 118 96.6% 8 10 80%
NetDuid.Tests.StaticTestData 16 3 19 87 84.2% 10 14 71.4%
NetDuid.Tests.XunitSerializers.DuidXunitSerializer 8 8 16 53 50% 4 8 50%


var small = new Duid(new byte[] { 0x00, 0x01, 0x00, 0x01 });
var medium = new Duid(new byte[] { 0x00, 0x01, 0x00, 0x01, 0x02 });
var large = new Duid(new byte[] { 0x00, 0x01, 0x00, 0x01, 0x02, 0x03 });
"Equals null",
() =>
{
Require(!a.Equals(null), "a.Equals(null) is false");
var y = new Duid(new byte[] { 0x00, 0x01, 0x00, 0x01, 0x01 });
Require(x.CompareTo(y) < 0, "x < y");
Require(y.CompareTo(x) > 0, "y > x");
Require(x.CompareTo(x) == 0, "x == x");
Comment thread smoketests/SmokeTests/Program.cs Fixed
Comment thread smoketests/SmokeTests/Program.cs Fixed
var y = new Duid(new byte[] { 0x00, 0x01, 0x00, 0x01, 0x01 });
Require(x.CompareTo(y) < 0, "x < y");
Require(y.CompareTo(x) > 0, "y > x");
Require(x.CompareTo(x) == 0, "x == x");
Comment on lines +21 to +25
catch (Exception ex)
{
Console.WriteLine($" [FAIL] {name}: {ex.Message}");
failed++;
}
rheone and others added 9 commits July 5, 2026 11:31
- Migrate from .sln to .slnx solution format, placed at repo root
- Move config files (global.json, .csharpierrc.json, stylecop.json) from src/ to repo root
- Replace src/.editorconfig with expanded root .editorconfig
- Add MSBuild infrastructure: Directory.Build.props, Directory.Build.targets, Directory.Packages.props (Central Package Management)
- Add smoketests/ directory with test project, run scripts (.sh/.ps1), and README
- Add CI/CD workflows: CodeQL, dependency review, Scorecard, smoke tests
- Add community/security files: CONTRIBUTING.md, SECURITY.md, .pre-commit-config.yaml
- Add benchmark run scripts (src/run-benchmarks.sh, src/run-benchmarks.ps1)
- Add test config (src/.runsettings)
- Update .gitignore, .gitattributes, .config/dotnet-tools.json, Husky hooks
- Update .csproj files and packages.lock.json for main project and tests
* Fix smoketest project build and test failures

- Add Version to PackageReference so -p:NetDuidVersion is consumed
- Add --framework to build step so net48 isn't built on Linux runners
- Add HUSKY:0 env var to prevent Husky hooks from failing on CI
- Fix CS1718 warning by using a separate instance for self-comparison
- Fix GetBytes read-only test to verify snapshot semantics instead
  of incorrectly checking for ICollection<T> interface absence

* fixes failing minimal smoketest
…nd test quality (#39)

* fix: trivial production code improvements

- M1: <remark> → <remarks> in Duid.IComparable.cs
- L1: Typo 'of RFC6355' → 'or RFC6355' in DuidType.cs
- M2: Replace obscure HexCharToUpper with char.ToUpperInvariant
- M3: Division/modulo → bit shifts for nibble extraction in IFormattable
- L3: Rename DuidRegexSource → DuidRegexPatterns for clarity

* perf: refactor DelimitedStringToBytes to use List<byte>

M8: Replace over-allocated array + Buffer.BlockCopy with List<byte>
that grows dynamically, eliminating wasted memory for inputs with
single-digit hex octets.

* fix: configuration and CI improvements

H1: Remove unconditional Microsoft.Bcl.HashCode (only needed for netstandard2.0)
H3: Remove dead TargetFrameworks from Directory.Build.props
H4: Fix double-encoded XML entity in test csproj
C1: Add --configuration Release to CI build for TreatWarningsAsErrors
C2: Add test step to publish workflow
C3: Fix wrong global.json path in CONTRIBUTING.md
C5: Collect coverage for net8.0 and net9.0 on Ubuntu
C6: Update stale smoke test docs in AGENTS.md
C8: Fix smoke test hex string length mismatch

* fix: Equals allocation and Lazy HashCode extraction

H2: Replace other.GetBytes() with other._duidBytes in Equals(Duid)
X2: Make Equals consistent with CompareTo field access pattern
M4: Extract _lazyHashCode initialization into InitializeLazyHashCode()

* test: improve test quality and coverage

T1: Rename misnamed Equal_Object_NotDuid test
T3: Add constructor test with List<byte> (non-array IEnumerable)
T4: Replace CompareTo-derived test data with independent expected values
T5: Add hash code stability and inequality tests

* fix: remove commented-out code and fix helper method

- Remove commented-out old HexCharToUpper method (triggers S125)
- Revert InitializeLazyHashCode to inline initialization (readonly field
  cannot be assigned from non-constructor method in partial class)

* warning / message cleanup

* updating readme and addressing missed test concern

* further cleanup

- Addressed warnings / messages
- Simplify cognitive complexity for formatting
- Adds `CodeAnalysis` attributes
- Updates SonarAnalyzer
* expands smoketests
* expands benchmarks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant