-
Notifications
You must be signed in to change notification settings - Fork 711
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
Incorporate PR feedback for link icon change #309
Conversation
The braces which I added were merged.
But I could be wrong, and basically I am fine with any convention. |
Right, the convention of a lot of this code is inconsistent - not just about brace location, but tabs/spaces and indent depth. There's some conversation about it in #88 . Reading it now, I overlooked this comment from Craig:
Unfortunately I'm not sure how to get to one PR for this without relying on a tool of some kind - the way some code indents with three spaces vs four for example is really hard to address manually. Braces are at least more visually obvious. I know some teams at Microsoft use clang-format now, although I've never found a set of options that really conform to the principles that humans find natural. |
But I doubt, that reformatting the whole source has an extra value at this stage of the project. |
src/treectl.c
Outdated
@@ -1692,15 +1692,19 @@ TCWP_DrawItem( | |||
|
|||
} else if (!(view & VIEW_PLUSES) || !(pNode->wFlags & TF_HASCHILDREN)) { | |||
if (bDrawSelected) { | |||
if (pNode->dwAttribs & ATTR_REPARSE_POINT) | |||
if (pNode->dwAttribs & (ATTR_SYMBOLIC | ATTR_JUNCTION)) | |||
{ |
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.
This is the Allman style.
src/treectl.c
Outdated
iBitmap = BM_IND_OPENREPARSE; | ||
else | ||
} else { |
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.
This is K&R style.
Agreed. This PR actually has two styles mixed together. I made comments on one case. Can we do one or the other? |
6cfdc71
to
d991b78
Compare
I think the challenge we have is trying to conform to neighboring code when the neighboring code is so inconsistent. Each function has examples of each style. Since this PR was already changing coding style of existing code, I tried to make the entire functions consistent. This commit attempts to use Allman, since that's what you'd expressed a preference for in #88 . It also uses spaces for indentation, using a shift width of 4. I think this is the style we're moving towards (right?) When reviewing the changes in Github, under the "files changed" tab there's a gear icon, and that allows the change to be viewed with or without whitespace. The whitespace changes are about using a shift width of 4; hiding these shows the bracing style changes. |
This project was written in K&R/3 spaces indent. Some changes are in Allman, but 90% are still in K&R now. With reformatting even partially to Allman/4 spaces you cause conflicts with all private builds, and open PRs. I personally favour Allman, and all my other stuff is Allman, but for this project I switched to K&R/3 spaces, and my 2 cents is, that it should stay as close to the original stuff. This simply is the spirit of Winfile, written some time in 198x. Changing the source formatting to Allman/4 spaces in my opinion has no benefit, and only introduces risk and problems. |
Short of a massive reformatting, staying with K&R/3 makes sense. Thanks! |
It seems we are stuck here a little bit. See schinagl:link_icon_feedback_proposal If this is fine four you @malxau, take it, push it and I guess @craig will sign it? |
d991b78
to
4710d52
Compare
Thanks @schinagl and sorry for going quiet. I looked at your change, and it doesn't include the addition of braces which I thought was something that needed doing. If we're not doing that, we also don't need to go over code formatting at all. So here's a brutally minimal change instead... |
This is addressing the feedback in #304 :