error WHITESPACE is an invalid report

Open
#2,299 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

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.

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:

using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Logging;

namespace MyProject.Handlers;

/// <summary>
/// Registers HTTP path routes and provides handlers for each route.
/// </summary>
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.

Dominant language
No language data
Stars
1.9k
Forks
173
Avg merge
10d 13h
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/format

All issues in dotnet/format

Similar issues

More CLI issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.