dotnet / dotnet/format

error WHITESPACE in face of collection expression

Open
#2,217 1 comment 7 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

dotnet --info
```
.NET SDK:
Version: 8.0.403
Commit: c64aa40a71
Workload version: 8.0.400-manifests.47119bbc
MSBuild version: 17.11.9+a69bbaaf5
```

`global.json`
```json
{
"sdk": {
"version": "8.0.403",
"rollForward": "latestPatch",
"allowPrerelease": false
}
}
```

`csproj`
```xml


Exe
net8.0
enable
enable

```

`Program.cs`
```csharp
Method();

static void Method()
{
byte[] expected = [0x01, 0x02,
0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C,
0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16];
}
```
Run `dotnet format --verify-no-changes` results in errors when it shouldn't:
```
Program.cs(5,29): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s'. [DotnetFormatIssueWhitespaceCollectionExpression.csproj]
Program.cs(6,9): error WHITESPACE: Fix whitespace formatting. Delete 15 characters. [DotnetFormatIssueWhitespaceCollectionExpression.csproj]
Program.cs(6,29): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s'. [DotnetFormatIssueWhitespaceCollectionExpression.csproj]
Program.cs(6,35): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s'. [DotnetFormatIssueWhitespaceCollectionExpression.csproj]
Program.cs(6,41): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s'. [DotnetFormatIssueWhitespaceCollectionExpression.csproj]
Program.cs(6,47): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s'. [DotnetFormatIssueWhitespaceCollectionExpression.csproj]
Program.cs(6,53): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s'. [DotnetFormatIssueWhitespaceCollectionExpression.csproj]
Program.cs(6,59): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s'. [DotnetFormatIssueWhitespaceCollectionExpression.csproj]
Program.cs(6,65): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s'. [DotnetFormatIssueWhitespaceCollectionExpression.csproj]
Program.cs(6,71): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s'. [DotnetFormatIssueWhitespaceCollectionExpression.csproj]
Program.cs(6,77): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s'. [DotnetFormatIssueWhitespaceCollectionExpression.csproj]
Program.cs(7,9): error WHITESPACE: Fix whitespace formatting. Delete 15 characters. [DotnetFormatIssueWhitespaceCollectionExpression.csproj]
Program.cs(7,29): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s'. [DotnetFormatIssueWhitespaceCollectionExpression.csproj]
Program.cs(7,35): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s'. [DotnetFormatIssueWhitespaceCollectionExpression.csproj]
Program.cs(7,41): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s'. [DotnetFormatIssueWhitespaceCollectionExpression.csproj]
Program.cs(7,47): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s'. [DotnetFormatIssueWhitespaceCollectionExpression.csproj]
Program.cs(7,53): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s'. [DotnetFormatIssueWhitespaceCollectionExpression.csproj]
Program.cs(7,59): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s'. [DotnetFormatIssueWhitespaceCollectionExpression.csproj]
Program.cs(7,65): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s'. [DotnetFormatIssueWhitespaceCollectionExpression.csproj]
Program.cs(7,71): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s'. [DotnetFormatIssueWhitespaceCollectionExpression.csproj]
Program.cs(7,77): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s'. [DotnetFormatIssueWhitespaceCollectionExpression.csproj]
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.