Codex .NET Format Verification with dotnet format
Check C# formatting against .editorconfig, report drift, and reuse the same verification command in CI.
中文Install in Codex
You need the .NET SDK, a solution or project path, and the project's style configuration.
- Copy the pinned `.codex/skills/dotnet-format/` directory into `.agents/skills/dotnet-format/` in the project.
- Run `dotnet format --version` and have Codex read the nearest `AGENTS.md` and `.editorconfig`.
Example task
Alter indentation in a C# file in a local example with `Demo.sln`. Ask Codex to run `dotnet format Demo.sln --verify-no-changes` and report the diagnostics.What to check
A configured indentation violation produces a nonzero exit code, the file stays intact, and the report identifies the file and rule.
Original SKILL.md on GitHub · Updated
Frequently asked question
How do I check whitespace only?
Use `dotnet format whitespace Demo.sln --verify-no-changes` to restrict the check to whitespace drift.