dotnet / dotnet/format

error WHITESPACE is an invalid report

Open
#2,299 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
1.9k
Forks
173
Avg merge
10d 13h
Merged PRs (30d)
1

Description

I used this: `dotnet format --verify-no-changes` on my project. It reported this:

> C:\Source\...\Handlers\HttpRequestHandler.cs(14,30): error WHITESPACE: Korrigieren Sie die Leerraumformatierung. Ersetzen Sie 4 Zeichen durch „\r\n\r\n“. [C:\Source\...\MyProject.csproj]

The relevant code looks like this:

```cs
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Logging;

namespace MyProject.Handlers;

///
/// Registers HTTP path routes and provides handlers for each route.
///
internal class HttpRequestHandler : RoutingRequestHandler
{
```

The given line and column are at the end of the `namespace` line (namespace itself edited, column may not match in this example).

What?!

I shall replace 4 (non-existing) characters (probably just the existing 2 line breaks which are `\r\n\r\n`) with – `\r\n\r\n`. That is no change at all. Why is this reported? And the tool output is full of these. Looks severely broken, can't use this thing at all.

I learned from a dotnet blog post that I could use this command in my agent instructions, but I'd better not do that if I want results.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the report with `dotnet format --verify-no-changes` using the shown namespace and blank lines, then inspect how the WHITESPACE diagnostic reports its line, column, and replacement text. Done means valid unchanged whitespace no longer produces misleading WHITESPACE errors or replacement instructions.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.