Skip to content

Align the repository with awesome-humans/dotnet - #193

Merged
si618 merged 5 commits into
mainfrom
verify-fixes
Oct 18, 2026
Merged

si618 merged 5 commits into
mainfrom
verify-fixes

Conversation

@si618

@si618 si618 commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes the findings from a verify-project review against awesome-humans/dotnet at 15e661e. Test names stay as they are, and tests stay beside their solutions.

  • Line endings: Normalises every file to LF without a BOM, and adds .gitattributes. This commit has no content changes, so review the others on their own.
  • Testing: Moves both test projects to xunit v3 on Microsoft.Testing.Platform, with the runner opt-in in global.json. Replaces coverlet with Microsoft.Testing.Extensions.CodeCoverage. The console app sets IsTestProject to false, so dotnet test doesn't try to run it.
  • Build: Directory.Build.props and Directory.Packages.props follow the templates: artifacts output, latest-recommended analysis, Meziantou.Analyzer, nullable warnings as errors, deterministic builds, and transitive pinning. FSharp.Core goes from 8.0.400 to 10.1.402, the version the SDK ships.
  • CI: Pins actions to commit SHAs, takes the SDK from global.json, sets contents: read by default and contents: write only for the benchmark job, and uploads TRX and Cobertura results.
  • Code style: Adopts the template .editorconfig, but keeps the repository's var style, PascalCase static readonly fields, and ReSharper settings. Rules that clash with LeetCode's given signatures or the partial Problem class are off, each with a reason: MA0048, MA0016, CA1002, CA1051, and MA0026. Spectre1010 is also off, because Spectre.Console.Analyzer 1.0.0 crashes on it.
  • Code fixes: Most come from dotnet format. The hand fixes are culture-aware formatting, a GeneratedRegex partial property with a match timeout, and a single dictionary lookup in TopKFrequent through CollectionsMarshal.GetValueRefOrAddDefault.
  • Console fix: Skips cursor moves when output is redirected. Without a terminal, Spectre.Console falls back to Console.SetCursorPosition, and list and benchmark threw ArgumentOutOfRangeException on main.
  • Docs: Adds writing-style and agent-attribution rules to AGENTS.md, updates the single-test command for MTP, and drops CLAUDE.md.

Test plan

  • dotnet build -c Release from a clean artifacts/ passes with no warnings.

  • dotnet format --verify-no-changes passes.

  • dotnet test -c Release runs 80 tests, and all pass. TRX and coverage files land in artifacts/test-results.

  • dotnet run --project LeetCode -c Release -- benchmark FizzBuzz --csharp completes in a terminal.

  • list and benchmark FizzBuzz --csharp succeed with output redirected to a file, and list still moves the cursor in a terminal.

si618 added 5 commits October 18, 2026 12:25
Adds .gitattributes so checkouts stay LF. No content changes.
- Opt in to the MTP runner in global.json, and roll the SDK forward with latestFeature.
- Replace xunit v2, Microsoft.NET.Test.Sdk, coverlet, and xunit.runner.visualstudio with
  xunit.v3 and Microsoft.Testing.Extensions.CodeCoverage.
- Align Directory.Build.props and Directory.Packages.props with the awesome-humans/dotnet
  templates: artifacts output, latest-recommended analysis, Meziantou.Analyzer, nullable
  warnings as errors, documentation file, deterministic builds, and transitive pinning.
- Pin FSharp.Core to 10.1.402, the version the .NET 10.0.400 SDK ships.
- Pin GitHub Actions to commit SHAs, take the SDK from global.json, set least-privilege
  permissions, and upload TRX and coverage results.
- Add a /build/ solution folder for the root build files.
Keeps this repository's var style, PascalCase static readonly fields, and ReSharper settings.
Silences rules that clash with LeetCode's given signatures and the partial Problem class,
each with a reason. Fixes the rest in code, mostly with dotnet format.
Drops CLAUDE.md, which only imported AGENTS.md, and updates the single-test command for MTP.
Spectre.Console falls back to Console.SetCursorPosition without a terminal, and moving up
from the first row threw ArgumentOutOfRangeException in list and benchmark.
@si618
si618 merged commit a783eaa into main Oct 18, 2026
2 checks passed
@si618
si618 deleted the verify-fixes branch October 18, 2026 02:16
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