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

Enhance whitespace issue logging with a detailed TextChange message #1017

Merged
merged 1 commit into from Mar 1, 2021

Conversation

@JoeRobich
Copy link
Member

@JoeRobich JoeRobich commented Feb 27, 2021

Since we are unable to report which rules were broken when applying the Roslyn formatter, this PR converts each TextChange into a detailed message reporting what type of change was made.

Possible resolution for #789

Example output:

The dotnet runtime version is '6.0.0-alpha.1.21064.11'.
Using MSBuild.exe located in '/usr/local/share/dotnet/sdk/6.0.100-alpha.1.21065.7/'.
Formatting code files in workspace '/Users/joeyrobichaud/Source/format/tests/projects/for_code_formatter/unformatted_project/unformatted_project.csproj'.
Loading workspace.
Project unformatted_project is using configuration from '/Users/joeyrobichaud/Source/format/.editorconfig'.
Project unformatted_project is using configuration from '/Users/joeyrobichaud/Source/format/tests/projects/for_code_formatter/unformatted_project/.editorconfig'.
Complete in 2167ms.
Determining formattable files.
Complete in 355ms.
Running formatters.
other_items/OtherClass.cs(5,3): Fix whitespace formatting. Delete 2 characters.
other_items/OtherClass.cs(6,3): Fix whitespace formatting. Delete 2 characters.
other_items/OtherClass.cs(7,5): Fix whitespace formatting. Delete 4 characters.
other_items/OtherClass.cs(8,5): Fix whitespace formatting. Delete 4 characters.
other_items/OtherClass.cs(9,7): Fix whitespace formatting. Delete 6 characters.
other_items/OtherClass.cs(10,5): Fix whitespace formatting. Delete 4 characters.
other_items/OtherClass.cs(11,3): Fix whitespace formatting. Delete 2 characters.
Program.cs(5,3): Fix whitespace formatting. Delete 2 characters.
Program.cs(6,3): Fix whitespace formatting. Delete 2 characters.
Program.cs(7,5): Fix whitespace formatting. Delete 4 characters.
Program.cs(8,5): Fix whitespace formatting. Delete 4 characters.
Program.cs(9,7): Fix whitespace formatting. Delete 6 characters.
Program.cs(10,5): Fix whitespace formatting. Delete 4 characters.
Program.cs(11,3): Fix whitespace formatting. Delete 2 characters.
other_items/OtherClass.cs(12,2): Fix final newline. Delete 1 characters.
Program.cs(12,2): Fix final newline. Delete 1 characters.
Complete in 544ms.
Formatted code file '/Users/joeyrobichaud/Source/format/tests/projects/for_code_formatter/unformatted_project/other_items/OtherClass.cs'.
Formatted code file '/Users/joeyrobichaud/Source/format/tests/projects/for_code_formatter/unformatted_project/Program.cs'.
Formatted 2 of 6 files.
Format complete in 3067ms.

Other types of messages:
Insert '\s\s'.
Replace 4 characters with '\t\t'.

jmarolf
jmarolf approved these changes Mar 1, 2021
@JoeRobich JoeRobich merged commit aea7ada into dotnet:master Mar 1, 2021
18 checks passed
@JoeRobich JoeRobich deleted the detailed-messages branch Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants