Repository navigation
Conversation
Adds CSharpier 1.4.0 and Husky.Net 0.9.1 as local tools, a pre-push hook that runs `dotnet csharpier check .`, an MSBuild target that installs the hook on restore (skipped in CI), and a csharpier job in CI. `dotnet format` in CI now checks only style and analyzers, since CSharpier owns whitespace. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ls2e1y2tkZNP6dfy8F5GTF
Runs `dotnet csharpier format .` (CSharpier 1.4.0, printWidth 120) on the whole repository. No other changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ls2e1y2tkZNP6dfy8F5GTF
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ls2e1y2tkZNP6dfy8F5GTF
Contributor
WalkthroughWarning Review details and warnings were omitted to fit the comment limit. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ls2e1y2tkZNP6dfy8F5GTF
TheMobileReferenceTests checks that the GreetingTests.cs excerpt in skills/e2e-dotnet/references/mobile.md appears line by line in the sample. CSharpier reflowed the ActAsync call in the sample, so the excerpt now quotes the formatted code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ls2e1y2tkZNP6dfy8F5GTF
Member
Author
|
@copilot resolve the merge conflicts on this branch. |
# Conflicts: # src/E2E/Agent/Act.cs # src/E2E/Agent/Agent.cs # src/E2E/Cache/Context.cs # src/E2E/Core/Launch.cs # src/E2E/Run/E2ESession.cs # tests/E2E.Tests/Core/CoreTests.cs Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Contributor
Resolved in merge commit |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sets up CSharpier for the repo, with a pre-push hook and a CI check.
What was added
dotnet-tools.json(repo root, where the .NET 11 SDK'sdotnet new tool-manifestputs it): local toolscsharpier1.4.0 andhusky(Husky.Net) 0.9.1..csharpierrc.json:printWidth: 120. The code already runs past 100 columns: about 5% of lines are over 137 characters, and the existing comments wrap near 120. No.csharpierignore, because there is no generated or vendored C#. CSharpier skipsbin/,obj/and gitignored files by default..husky/: apre-pushhook that runs thepre-pushtask group fromtask-runner.json. That group runsdotnet csharpier check ., so a push with unformatted files fails.ci.yml): a newcsharpierjob runsdotnet tool restoreanddotnet csharpier check .on pull requests and on pushes tomain.Formatstep: now runsdotnet format styleanddotnet format analyzersinstead of the fulldotnet format. The whitespace pass ofdotnet formatconflicts with CSharpier's layout: it reportedWHITESPACEerrors on the formatted code. CSharpier now owns whitespace. Style and analyzer checks are unchanged.dotnet csharpier format .before every commit or push. The pre-push hook blocks unformatted pushes. Use onlydotnet format styleanddotnet format analyzers, neverdotnet format whitespaceor a plaindotnet format.How the pre-push hook gets installed
src/E2E/E2E.csprojhas aHuskyMSBuild target, the one Husky.Net recommends. It runs beforeRestore;CollectPackageReferencesand callsdotnet tool restore, thendotnet husky install, which setscore.hooksPathto.husky. Every project referencesE2E, so any restore or build installs the hook. The target is skipped when:CIistrue(GitHub Actions sets it),.gitat the repo root (source archives, for example),HUSKY=0is set (the opt-out).To install the hook by hand, run
dotnet tool restore, thendotnet husky install.Commits and
.git-blame-ignore-revse6850c0: tooling, hook, CI, and docs.eaacd7bFormat codebase with CSharpier: only the output ofdotnet csharpier format .(1,586.cs, 5.xaml, 2.xml, 2.csproj).962a9fbadds.git-blame-ignore-revswitheaacd7b. GitHub uses it automatically. Locally, rungit config blame.ignoreRevsFile .git-blame-ignore-revs.879d477adds the CSharpier rules to CLAUDE.md.9a0f2ebupdates theGreetingTests.csexcerpt inskills/e2e-dotnet/references/mobile.mdto match the formatted sample.TheMobileReferenceTestschecks that the excerpt appears in the sample line by line. CSharpier reflowed theActAsynccall there, so the test failed on the first CI run.Please merge with a merge commit or a rebase merge, not a squash. A squash merge changes the format commit's SHA, and the entry in
.git-blame-ignore-revswould then point at nothing.Analyzer rules
None disabled. After formatting,
dotnet build E2E.slnx -c Release(withTreatWarningsAsErrorsandEnforceCodeStyleInBuild) passed with 0 warnings and 0 errors.dotnet format styleanddotnet format analyzerswith--verify-no-changesalso passed. The only conflict is thedotnet formatwhitespace pass, which is handled above.Verification notes
The sandbox this PR came from had no access to NuGet or the .NET SDK downloads. So the tool install, the formatting, and the build ran on GitHub Actions, on throwaway branches
tmp/csharpier-bootstrapandtmp/csharpier-formatted. The workflow only ever ran on those branches. Its formatted commit was then cherry-picked here unchanged. On that runner:dotnet csharpier check .passed (1,841 files).E2E.slnxpassed.CIunset ran theHuskytarget, which created.husky/_/husky.shand setcore.hooksPath=.husky.Tests: the full CI suite runs on this PR. Its first run caught the excerpt mismatch that
9a0f2ebfixes.Not run:
/code-review. It was not available in that session.To clean up:
tmp/branches. Please delete them.apps/WinAppBenchmark(where the.xamlchanges are) is checked by thewindows-build-testjob on this PR.https://claude.ai/code/session_01Ls2e1y2tkZNP6dfy8F5GTF
Generated by Claude Code