Skip to content

build: add editorconfig, analyzers and CI formatting check#7

Merged
jonas1307 merged 2 commits into
masterfrom
chore/code-formatting
Jun 26, 2026
Merged

build: add editorconfig, analyzers and CI formatting check#7
jonas1307 merged 2 commits into
masterfrom
chore/code-formatting

Conversation

@jonas1307

Copy link
Copy Markdown
Owner

What

Introduces code style and linting tooling integrated with the build.

Tooling

  • .editorconfig — style rules aligned to the existing conventions (file-scoped namespaces, usings outside the namespace, 4-space indent, var/expression-bodied/collection-expression preferences). EF Core migrations are excluded as generated code.
  • Directory.Build.props — enables .NET analyzers + EnforceCodeStyleInBuild for all projects as warnings (conservative profile: surfaces issues without breaking the build).
  • .github/workflows/ci.yml — runs on pull requests to master: restore → dotnet format whitespace --verify-no-changes → Release build.

Normalization applied

  • UTF-8 BOM removal and final-newline fixes across 12 files (whitespace only).
  • Two remaining block-scoped namespaces converted to file-scoped, making the codebase uniform.

Why

There was no formatter or linter wired into the build, so style drift wasn't caught anywhere. This adds a predictable, low-friction gate.

Notes for reviewers

  • The CI gate enforces whitespace only (dotnet format whitespace). Full dotnet format was deliberately avoided because its analyzer pass applied unwanted semantic rewrites (e.g. making DbSet<> properties nullable). The analyzers still run during dotnet build as informational warnings.
  • Migrations are excluded from formatting to avoid hundreds of lines of churn in generated files.
  • end_of_line is intentionally not enforced in .editorconfig and the existing .gitattributes is untouched, to avoid fighting Git's autocrlf on Windows.
  • Build is clean: 0 warnings, 0 errors; whitespace verification passes.

🤖 Generated with Claude Code

@jonas1307 jonas1307 merged commit 55eb2b8 into master Jun 26, 2026
1 check passed
@jonas1307 jonas1307 deleted the chore/code-formatting branch June 26, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant