-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[cleanup] improve comment alignment in gtlist.h #121784
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
base: main
Are you sure you want to change the base?
[cleanup] improve comment alignment in gtlist.h #121784
Conversation
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.
Pull Request Overview
This PR improves the visual alignment of comments in gtlist.h by replacing comma-based placeholders with a clearer column alignment scheme using pipe characters (|) and arrows (v). The new format makes the comment structure more readable by explicitly showing the vertical alignment between the column headers and the actual GTNODE macro parameters.
Key Changes:
- Replaced floating commas in comments with explicit pipe characters (
|) to show column boundaries - Added arrows (
v) to clearly indicate which comment header corresponds to which macro parameter - Improved visual clarity while maintaining the same informational content
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
src/coreclr/jit/gtlist.h
Outdated
| // | | ||
| // | , GenTree struct flavor | ||
| // | | | ||
| // | | ,commutative | ||
| // | | | | ||
| // | | |,illegal as VN func | ||
| // | | | | | ||
| // | | | |,(oper kind | DEBUG oper kind) | ||
| // | | | | | | ||
| // v v v v v |
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.
I do not personally find this to be more readable, rather I find it visually distracting instead
I think it would be less problematic if this were just repeating the commas down or instead made each column bigger so all "column headers" could be on one line
but I also think this is fine as it is and can probably avoid unnecessary churn
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.
Thanks for your review and suggestions. I've updated the formatting by repeating the commas down from the existing comma, as you recommended.
If you still feel this change introduces unnecessary churn, please feel free to close the PR. For context, as a newcomer to .NET, the original formatting was a bit hard for me to grasp at first glance, so I tried adjusting it for readability.
This change improves the readability of comments in
gtlist.h.Previously, the comment columns were visually aligned by placing commas in the
same positions as the actual argument separators. While this kept the columns
technically aligned, the presence of "floating commas" in the comments made the
structure harder to parse at a glance.
The updated version replaces those comma placeholders with clearer alignment
cues, making the layout easier to understand.
No behavioral changes.
Part of #84834, cc @dotnet/samsung
@SkyShield @namu-lee