dennisdoomen / dennisdoomen/dotnet-library-starter-kit

[Feature]: Enforce the .editorconfig formatting rules in the build

Open
#116 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
77
Forks
5
PR merge metrics
No merged PRs in 30d

Description

### Background and motivation

The templates ship a carefully tuned `.editorconfig`, honoured by Rider and ReSharper. But nothing verifies formatting in CI. A contributor using plain Visual Studio Code, or an AI agent, can produce a pull request that ignores the formatting rules entirely, and the build stays green.

Proposal: add a build target that runs `dotnet format --verify-no-changes` (or the equivalent Fallout task), so formatting violations fail the build with a clear message instead of turning into review comments.

### Alternative Concerns

* Many of the layout rules in the `.editorconfig` are ReSharper-specific and `dotnet format` does not understand them, so this only enforces the subset that the Roslyn formatter supports. That is still better than nothing, but the limitation should be documented so nobody assumes full coverage.
* InspectCode (#50) already runs and does understand the ReSharper rules. An alternative is to make the relevant InspectCode severities fail the build instead of only producing SARIF. That may be the better route.
* Formatting failures are annoying when they block an otherwise good pull request, so the message should point at the exact command that fixes it.

### Could you help with a pull-request?

No

Contributor guide

Open the contributing guide

Research direction

Start by reading the repository's .editorconfig and the existing InspectCode setup referenced by issue #50. Compare enforcing dotnet format --verify-no-changes with the equivalent Fallout task, including which rules each understands. Done means the build fails clearly on supported formatting violations and points contributors to the exact fixing command, with the coverage limitation documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system, ci-cd, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.