-
Notifications
You must be signed in to change notification settings - Fork 172
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 whitespace --verify-no-changes fails on"/" char #1955
Comments
From the whitespace errors it appears to be trying to fixup indentation by replacing characters with tabs. Is it possible there are mixed spaces and tabs? Also, are the line numbers accurate? |
One more error example, maybe it will bring something new. |
So we are always checking these files out with windows line endings. Does your .editorconfig also specify |
Currently not, previously I had it but there was more errors than now, should I bring it back? If yes, how should I update some files on git to crlf format? By running I tried to run |
You can try these steps https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings#refreshing-a-repository-after-changing-line-endings |
Already done this, just to be sure I did it again today, but some files are still in lf format.
|
Not saying this is the issue, just something I noticed after looking at a few .gitattributes files (see https://grep.app/search?q=.cs+text+eol). You could simplify yours by removing the directory separators. # Set the default behavior, in case people don't have core.autocrlf set.
- */ text=auto
+ * text=auto
# Declare files that will always have CRLF line endings on checkout.
- **/*.cs text eol=crlf
+ *.cs text eol=crlf Not sure how much more help I can be. In the absence of an end_of_line settings in the .editorconfig, dotnet-format will default to using the environment newline for line endings, which may not match your .gitattributes configuration. So, if you are not letting git automatically handle line endings you will want to configure your .editorconfig to match. |
Also note that you want to make this change: -*.cs text eol=crlf
+*.cs text=auto eol=crlf
|
Closing this issue as we've seen no reply to the request for more information. If you are able to get the requested information, please add it to the issue and we will retriage it. |
Can you provide an example of your preferred configuration? sharwell |
Hi everyone,
as in title dotnet format whitespace --verify-no-changes fails in lines where "/" char is.
I am running command with git workflow so it might be related to this.
Error:
Program.cs(6,3): error WHITESPACE: Fix whitespace formatting. Replace 4 characters with '\n\t\t'.
Program.cs(12,1): error WHITESPACE: Fix whitespace formatting. Replace 2 characters with '\t\t'.
This is the content of my .gitattributes file:
The text was updated successfully, but these errors were encountered: