-
Notifications
You must be signed in to change notification settings - Fork 163
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
Remove trailing whitespace from all files in lib
#5268
Remove trailing whitespace from all files in lib
#5268
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.
I'm happy with this kind of change.
@fingolfin suggested in #5260 (review) that:
we could set up a
.git-blame-ignore-revs
file to ignore the changes in that commit for purposes of git blame and similar
I don't know how this would work, but I presume @fingolfin does, and I presume it can only be done after these commits are merged. I'm just noting it here so the idea doesn't get lost.
Thanks @wilfwilson I think I've added the appropriate file also. |
Ooops included an extra commit, I didn't mean to, will remove now |
2226cc5
to
b89690d
Compare
@james-d-mitchell I don't think that In addition, there are two relevant commits to ignore (the tab one and the trailing whitespace one), not just one, so ultimately two commits will need to be listed. |
Aha, thanks @wilfwilson, that makes sense, I'll drop that commit. |
b89690d
to
ec518aa
Compare
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.
Thank you!
In principle I am all for this. The main objection I am aware of are:
- this could cause conflicts for in-flight PRs: OK, we have ~65 open PRs; but the majority of those are dormant and old and either are trivial to rebase or need major rebasing work anyway, and I don't intend to be held hostage by old unfinished work (which includes many of my own PRs -- I will gladly rebase them through whitespace changes, and also am happy to assist others with theirs)
- there may also be unsubmitted big changes -- well, if you don't show your work via a PR, we can't take it into account
- it "break git blame etc." -- but that's what we have
.git-blame-ignore-revs
for (to be added in a future PR)
So all in all I don't mind. In fact I have ulterior motives, I want to make some code formatting tweaks to the kernel code ;-).
But the tab changes are delicate. I would recommend to separate the "remove trailing whitespaces" changes and the tab changes into separate PRs. Then we can merge the "remove trailing tabs" PR rather quickly, but the tabs require careful vetting (and perhaps need to be done in multiple steps, i.e., convert just a couple files carefully and submit that, and deal with others later). Also, trailing spaces could also be removed in src
and in doc/*/*.xml
and possibly in grp
.
Oh, and actually: please make sure to at least also apply all these changes to hpcgap/lib
, to avoid divergence between those files and their counterparts in lib
lib/algfld.gi
Outdated
q:= Quotient( R, g, factor ); | ||
Add( factors, factor ); | ||
g:= q; | ||
q:= Quotient( R, g, factor ); |
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.
Indentation is broken here. I would advise against trying to remove tabs with a fully automated script: in many places our tabs are 8 wide, but I think there are exceptions with 4 wide tabs (and who knows what else)
I like this, but I wonder if we should try to do it in a series of smaller pieces? (I wouldn't mind a little more churn) I think a "strip whitespace off the end of lines" commit can be merged with basically no questions, whereas as @fingolfin says I've noticed in the past tabs require some manual work, as some are 4 space indents and some are 8 space indents. |
ec518aa
to
7ffb71f
Compare
I've dropped the remove tabs from this PR, I can see the rationale for replacing tabs more carefully (although the idea that anything could make the formatting of the library worse is amusing). |
About HPC gap, I just did the same transformation on |
lib
lib
I'd appreciate the trailing whitespace being removed! As @fingolfin says, it hits git blame, but that can be got around with the ignore file. I also agree that tabs are more delicate – a fully automated removal might make things worse. |
@james-d-mitchell hpcgap/lib mirrors a small subset of files from lib with patches applied. Those files need to be "in sync". The hundreds of additional files in lib simply are identical between GAP and HPC-GAP. So nothing to reexamine there :-) |
@fingolfin aha, I see, ok, I'll add that to the PR now. |
I will remove a couple more trailing whitespace with a direct push momentarily, and add |
Thanks @fingolfin ! |
Done. And of course I idiotically broken the tests based on manual examples, so I'll fix that ASAP. |
This PR removes all tabs and trailing whitespace in all files in the
lib
directory, as mentioned in #5260. I could also add a CI job that would fail if tabs or trailing whitespace are introduced again in the future, but since I expect this will be controversial enough without that too, I haven't done it.Text for release notes
None