The solution is formatted with the ReSharper command-line formatter
(JetBrains.ReSharper.GlobalTools),
pinned in the dotnet tool manifest (.config/dotnet-tools.json) so every contributor runs the
same version. Whitespace rules come from the repository .editorconfig; the member layout and the
cleanup profile live in RustPlusApi.sln.DotSettings.
dotnet tool restore
dotnet jb cleanupcode RustPlusApi.sln --profile="ReformatAndReorder"The ReformatAndReorder profile reformats and puts type members in the configured order (fields, properties, events, then methods, each grouped by accessibility). It never applies code-style rewrites or syntax changes.
A committed pre-push hook
keeps unformatted code from leaving your machine:
- It collects the
*.cs,*.csproj,*.propsand*.targetsfiles touched by the commits being pushed (new branches are compared againstorigin/develop). - It runs the formatter scoped to just those files.
- If the formatter changes anything, the push is rejected and the fixed files are left in your working tree — review them, amend or commit, then push again.
Pre-existing local edits are ignored: only files the formatter itself modifies fail the check.
None. Building any project once (dotnet build) points git at the committed hooks via
git config core.hooksPath .githooks (a target in Directory.Build.props; skipped on CI).
For emergencies only:
git push --no-verify