Add dotnet format to CI for C# code style validation#138
Merged
Conversation
- Fix existing code style violations in 25 C# files - Add dotnet format step to CI lint job with .NET setup - Add lint-dotnet and lint-dotnet-fix targets to Makefile - Update .editorconfig to align Rider with dotnet format - Update CLAUDE.md and CONTRIBUTING.md documentation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR enforces C# code style consistency by integrating dotnet format validation into the CI pipeline. It addresses existing formatting violations and updates documentation to reflect the new linting requirements.
Changes:
- Added
dotnet format --verify-no-changesto CI lint job to catch formatting violations automatically - Created Makefile targets (
lint-dotnet,lint-dotnet-fix) for local C# formatting validation and fixes - Fixed code style violations across 25 C# files and aligned
.editorconfigReSharper settings with Roslyn defaults
Reviewed changes
Copilot reviewed 10 out of 31 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/ci.yml | Added dotnet format verification step to CI lint job |
| Makefile | Added lint-dotnet and lint-dotnet-fix targets for C# formatting |
| CONTRIBUTING.md | Updated contribution guidelines to include C# formatting requirements |
| CLAUDE.md | Added dotnet format documentation and tool installation instructions |
| .editorconfig | Aligned ReSharper logical not operator spacing with Roslyn defaults |
| tests/Keystone.Cli.UnitTests/Domain/Policies/EntryModelPoliciesTests.ExcludeUserContent.cs | Added missing public access modifier to partial class |
| tests/Keystone.Cli.UnitTests/Domain/Policies/EntryModelPoliciesTests.ExcludeGitContent.cs | Added missing public access modifier to partial class |
| tests/Keystone.Cli.UnitTests/Domain/Policies/EntryModelPoliciesTests.ExcludeGitAndUserContent.cs | Added missing public access modifier to partial class |
| src/Keystone.Cli/Application/Data/Stores/SyncFileProjectModelStore.cs | Reordered using statements alphabetically |
| keystone-cli.sln.DotSettings | Reformatted XML and added spell-check dictionary entries |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Enforces .editorconfig compliance for C# code by adding dotnet format verification to CI. Code style violations are now caught automatically before merge, ensuring consistent formatting across the codebase.
Related Issues
Fixes #135
Changes
dotnet format --verify-no-changesstep to CI lint joblint-dotnetandlint-dotnet-fixtargets to Makefile.editorconfigReSharper settings with Roslyn formatter defaults