Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error WHITESPACE in face of collection expression #2217

Open
nietras opened this issue Oct 18, 2024 · 0 comments
Open

error WHITESPACE in face of collection expression #2217

nietras opened this issue Oct 18, 2024 · 0 comments

Comments

@nietras
Copy link

nietras commented Oct 18, 2024

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

{
  "sdk": {
    "version": "8.0.403",
    "rollForward": "latestPatch",
    "allowPrerelease": false
  }
}

csproj

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>
</Project>

Program.cs

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]
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

No branches or pull requests

1 participant