-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8311043: Remove trailing blank lines in source files #14698
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
Conversation
|
👋 Welcome back lkorinth! A progress list of the required criteria for merging this PR into |
|
@lkorinth The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
|
@lkorinth This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 16 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
|
This seems to run contrary to the requirement that files end in a newline, which git will complain about if the newline is missing. It also seems far too large and disruptive. |
The patch is leaving exactly one newline at the end of the file. |
Do you still think it is too disruptive after Erik's explanation? I could split it in more reviews, but I thought that maybe it would just make the review harder. I was hoping the two |
|
Why do we care about this? |
|
Neither the PR diffs nor the webrev make it easy to see exactly what is being changed here. It appeared to me that the last empty line of each file was being deleted, leaving no newline at the end. But to me this is too disruptive with no tangible benefit. And you need buy-in from all the different areas affected by this. |
I care because of global-whitespace-cleanup-mode (in emacs). It helps me remove trailing whitespaces and blanklines when saving but it will not fix a file that was "dirty" when it was opened. Trailing blank lines triggers it not to clean whitespaces for me. And it does not look good. |
|
You could fix your emacs functions. |
My changes look like this in the diff output Removal of the last newline would look like this: (both with I have not tested if this is also true for the generated webrevs, but I think that is precisely how they are created. |
It is a very nice feature of global-whitespace-cleanup-mode |
|
Per had an emacs feature to remove whitespaces at the end of the line, and gave me the vim version of that. That's a nice feature. I object to this change. |
|
This was not liked, I will close it. I will possibly do it under another PR for the GC code. Thanks for reviewing. |
Thanks for showing this and other output. To me this looked like the final newline had been removed. I would have expected to see something that more obviously showed more than one blank line before hand and exactly one after. |
|
Ending the file with a blank line? I would not have expected that at all. |
Remove trailing "blank" lines in source files.
I like to use global-whitespace-cleanup-mode, but I can not use it if the files are "dirty" to begin with. This fix will make more files "clean". I also considered adding a check for this in jcheck for Skara, however it seems jcheck code handling hunks does not track end-of-files. Thus I will only clean the files.
The fix removes trailing lines matching ^[[:space:]]*$ in
I have applied the following bash script to each file:
git diff --ignore-space-change --ignore-blank-lines masterdisplays no changesgit diff --ignore-blank-lines masterdisplays one changeProgress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14698/head:pull/14698$ git checkout pull/14698Update a local copy of the PR:
$ git checkout pull/14698$ git pull https://git.openjdk.org/jdk.git pull/14698/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 14698View PR using the GUI difftool:
$ git pr show -t 14698Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14698.diff
Webrev
Link to Webrev Comment