-
Notifications
You must be signed in to change notification settings - Fork 6k
Run dotnet format #19794
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
Run dotnet format #19794
Conversation
Before I proceed with checking access-by-line.txt, I'll wait for a feedback whether you can accept this PR or you want to take a smaller PR (an option for taking a smaller PRs could be to use specific editorconfig options at first). This is a list of all the access-by-line.txt files in the repository:
I've manually checked until "samples\snippets\csharp\tour\types-and-variables\access-by-line.txt", and fixed some line numbering issues. An automated solution would be much easier than checking these manually. |
//(used if a resource is not found in the page, | ||
// or application resource dictionaries) | ||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located | ||
//(used if a resource is not found in the page, | ||
// app, or any theme specific resource dictionaries) | ||
//(used if a resource is not found in the page, | ||
// app, or any theme specific resource dictionaries) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intended? What option in editorconfig can control this?
I've manually reviewed that no other line numbering has changed. |
@Youssef1313 Thanks for your efforts on this, but the team prefers not to accept bulk change PRs without a demonstrable need. That applies especially to code files when there are too many to review, let alone test. A problem for this PR in particular is the fact that some snippets may not follow editorconfig by design. Also, access-by-line.txt files are not a reliable way to find every instance where line numbers are in fact referenced; a file's presence alerts you to line number use but its absence doesn't guarantee the absence of line number use. Even if we could invest the amount of effort required to review these changes thoroughly enough, the limited benefit isn't enough to make that work the best use of the limited resources we have available. To avoid wasted effort, in the future when you have an idea that will take a significant amount of time to implement, please start by creating an issue to find out if it's going to be something the team agrees is needed and worth the time to review related PRs. |
@tdykstra, There are two options in editorconfig that will never cause any problems (doesn't affect line numbers, and will never be made intentionally), and the fact of the huge files changed is actually caused by them. They are:
I'm thinking of two possibilities:
Pinging @sharwell for the utf-8-bom thing, I think he opened one PR before to add the bom char to all files in samples repo. I'm not sure why it might be important to use utf-8-bom. |
dotnet/samples#1085 These are @sharwell PRs I'm referring to for adding the BOM char |
When the BOM is missing, some editors will improperly load file content under a different default encoding. The most common scenario where I have observed this is repositories containing author names in comments, and you can see over time many names have lost their original characters. utf-8-bom is the most consistently handled file encoding, covering all modern text editors both with and without support for .editorconfig, and is thus the least likely to produced invalid file content over time in a distributed team. |
@sharwell What tool did you use to make your PRs in the samples repo? |
I use a script, but then I manually verify that each character has the same interpretation under known default encodings, and verify correct interpretation for any differences that appear. |
@sharwell, would it be okay if I ran dotnet format with only bom option? I'm unsure of how you verify correct interpretation for any differences |
@Youssef1313 I can run my script on this repository to see what condition it is currently in |
@sharwell Great. |
@Youssef1313 I filed #19825 with the changes I verify correctness by reviewing each character change (under a binary diff) aside from the addition of the BOM itself. |
This PR just runs
dotnet format . --folder
command in the repository root.The only concern is if a file is referenced by line number, so please hold off on merging this until I try to see a solution to make sure that none of these are accessed by line.
This is a list of the changed files in the PR.
editorconfig needs a very careful review, as the dotnet format tool relies on it.