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

[dotnet format] Different whitespace errors reported by --verify-no-changes when using indent_style = tab #43098

Open
coavins opened this issue Aug 29, 2024 · 0 comments
Labels
Area-Format untriaged Request triage from a team member

Comments

@coavins
Copy link

coavins commented Aug 29, 2024

Describe the bug

Different whitespace errors are reported by --verify-no-changes when using indent_style = tab.
I expected --verify-no-changes to report exactly the same errors that would have been fixed if this option were omitted.

This issue seems to be related to the presence of comments in the file.

See also: dotnet/format#2045

To Reproduce

Put the following source file and .editorconfig into a new folder:
https://gist.github.com/coavins/7734bfd8d661910144b36122b092fe30

root = true

[*.cs]
indent_style = tab

There is one whitespace error included on line 13.
Run dotnet format whitespace --folder . -v d --verify-no-changes
See it report five whitespace errors (one for line 13 plus two more for each comment in the file)
Remove one of the comments and repeat the above command, see it report three whitespace errors.
Run dotnet format whitespace --folder . -v d
See it fix one whitespace error as expected.

Further technical details

dotnet --info
.NET SDK:
 Version:           8.0.401
 Commit:            811edcc344
 Workload version:  8.0.400-manifests.b6724b7a
 MSBuild version:   17.11.4+37eb419ad

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.401\

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
There are no installed workloads to display.

Host:
Version: 8.0.8
Architecture: x64
Commit: 08338fcaa5

.NET SDKs installed:
8.0.401 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
None

Environment variables:
Not set

global.json file:
Not found

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Workloads untriaged Request triage from a team member labels Aug 29, 2024
@coavins coavins changed the title Different whitespace errors reported by --verify-no-changes when using indent_style = tab [dotnet format] Different whitespace errors reported by --verify-no-changes when using indent_style = tab Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Format untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

2 participants