Skip to content

Conversation

xtqqczze
Copy link
Contributor

@xtqqczze xtqqczze commented Sep 3, 2025

This PR normalizes whitespace in .resx files across the repository.

Changes

  • Remove trailing whitespace (via regex [ \t]+$).
  • Ensure all files end with exactly one newline (using a Python script).

Motivation

The repository's .editorconfig specifies:

trim_trailing_whitespace = true
insert_final_newline = true

Many editors enforce these settings automatically. Without normalizing the existing .resx files, unrelated whitespace changes can show up in otherwise unrelated PRs.

By cleaning this up now, we reduce noise and friction in future contributions.

Notes

  • Only whitespace was modified.
  • No resource content or functional changes were made.

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Sep 3, 2025
@dotnet-policy-service dotnet-policy-service bot added linkable-framework Issues associated with delivering a linker friendly framework community-contribution Indicates that the PR has been added by a community member labels Sep 3, 2025
@xtqqczze xtqqczze force-pushed the trim-trailing-whitespace-resx branch from 7513dc0 to c40a761 Compare September 3, 2025 09:52
@xtqqczze xtqqczze changed the title Trim trailing whitespace is .resx files Normalize whitespace in .resx files Sep 3, 2025
@MichalStrehovsky
Copy link
Member

By cleaning this up now, we reduce noise and friction in future contributions.

The Visual Studio RESX editor adds these whitespaces so this removes friction somewhere and adds it elsewhere.

Could we instead add a line that disables these editorconfig rules for RESX?

@xtqqczze xtqqczze marked this pull request as draft September 3, 2025 10:47
@xtqqczze
Copy link
Contributor Author

xtqqczze commented Sep 3, 2025

By cleaning this up now, we reduce noise and friction in future contributions.

The Visual Studio RESX editor adds these whitespaces so this removes friction somewhere and adds it elsewhere.

Could we instead add a line that disables these editorconfig rules for RESX?

I think the Visual Studio RESX editor adds the whitespace to new files, not to existing files.

We already have many existing files that have the trailing whitespace removed.

@MichalStrehovsky
Copy link
Member

I think the Visual Studio RESX editor adds the whitespace to new files, not to existing files.

No, it will add it if it's missing.

@xtqqczze
Copy link
Contributor Author

xtqqczze commented Sep 3, 2025

I think the Visual Studio RESX editor adds the whitespace to new files, not to existing files.

No, it will add it if it's missing.

What is the editor's behaviour with respect to final newline?

@MichalStrehovsky
Copy link
Member

What is the editor's behaviour with respect to final newline?

It removes the final newline

@xtqqczze
Copy link
Contributor Author

xtqqczze commented Sep 3, 2025

What is the editor's behaviour with respect to final newline?

It removes the final newline

I see, so this PR does indeed add friction.

Could you confirm whether this behaviour is in the new Visual Studio Resource Explorer, or the old Resource Editor?

@MichalStrehovsky
Copy link
Member

Could you confirm whether this behaviour is in the new Visual Studio Resource Explorer, or the old Resource Editor?

It's the thing that shows up when one double clicks the resx file:

image

@xtqqczze xtqqczze closed this Sep 3, 2025
xtqqczze added a commit to xtqqczze/dotnet-runtime that referenced this pull request Sep 3, 2025
tannergooding pushed a commit that referenced this pull request Sep 11, 2025
* Update `.editorconfig` to adjust settings for `.resx` files to match VS

Context: #119302 (comment), dotnet/android#4954.

* Convert `.resx` files to `utf8` encoding (remove BOM)

The following script was used:
```sh
for file in $(find . -name '*.resx' -type f); do
  gsed -i '1s/^\xEF\xBB\xBF//' $file
done
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution Indicates that the PR has been added by a community member linkable-framework Issues associated with delivering a linker friendly framework needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants