Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:

- name: Check Code Formatting
run: |
# dotnet format is built into .NET 6+ SDK (no separate installation needed)
# Find solution file
solution=$(find . -maxdepth 2 \( -name "*.sln" -o -name "*.slnx" \) | head -n 1)

Expand Down
6 changes: 6 additions & 0 deletions README-FORMATTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

This repository uses `dotnet format` to enforce consistent C# code style.

## Prerequisites

The `dotnet format` command is **built into the .NET SDK** starting with .NET 6 and later. Since this project requires .NET 8.0 SDK or later, you already have `dotnet format` available — no separate tool installation is needed.

> **Note:** The standalone `dotnet-format` global tool was deprecated when `dotnet format` was integrated into the .NET 6 SDK in August 2021.

## For Developers

### Before Committing
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ This project is licensed under the **MIT License**. See the [LICENSE](LICENSE) f

- **API Documentation:** Generated via DocFX (see `docfx_project/`)
- **Formatting Guide:** [README-FORMATTING.md](README-FORMATTING.md)
- **Setup Instructions:** [SETUP.md](SETUP.md)
- **Contributing Guide:** [CONTRIBUTING.md](CONTRIBUTING.md)

---

Expand Down
21 changes: 21 additions & 0 deletions format.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,27 @@ $ErrorActionPreference = "Stop"
Write-Host "🎨 Code Formatting Script" -ForegroundColor Cyan
Write-Host ""

# Verify dotnet format is available (built into .NET 6+ SDK)
Write-Host "🔍 Checking for dotnet format..." -ForegroundColor Yellow
dotnet format --version | Out-Null

if ($LASTEXITCODE -ne 0)
{
Write-Host ""
Write-Host "❌ dotnet format is not available!" -ForegroundColor Red
Write-Host ""
Write-Host "The 'dotnet format' command is built into the .NET SDK starting with .NET 6." -ForegroundColor Yellow
Write-Host "This project requires .NET 8.0 SDK or later." -ForegroundColor Yellow
Write-Host ""
Write-Host "Please install the .NET 8.0 SDK or later from:" -ForegroundColor Yellow
Write-Host "https://dotnet.microsoft.com/download" -ForegroundColor Cyan
Write-Host ""
exit 1
}

Write-Host "✅ dotnet format is available" -ForegroundColor Green
Write-Host ""

# Find solution file
$solutions = Get-ChildItem -Path . -File | Where-Object { $_.Extension -eq '.sln' -or $_.Extension -eq '.slnx' } | Select-Object -First 1

Expand Down
Loading