Download & Extend

Remove all trailing whitespace from Drupal core files.

Project:Drupal core
Version:8.x-dev
Component:other
Category:task
Priority:normal
Assigned:Unassigned
Status:needs review
Issue tags:Novice, Quick fix, quickfix

Issue Summary

While submitting unrelated patches, I have noticed several core files that have trailing whitespace. This can easily be cleared up via the following one-line command:

perl -pi -e 's, *$,,' $(find core -regex '.*\.\(engine\|html\|inc\|info\|install\|js\|json\|module\|php\|script\|sh\|sql\|test\|txt\|xml\)')

Comments

#1

Great. Maybe it would also be possible to remove trailing whitespace from patch files uploaded to Drupal.org. But that's for another issue queue...

#2

Status:active» needs review

Patch.

AttachmentSizeStatusTest resultOperations
remove-trailing-whitespace-1419298.patch0 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 33,353 pass(es).View details | Re-test

#3

(sigh) For real, this time.

AttachmentSizeStatusTest resultOperations
remove-trailing-whitespace-1419298-2.patch12.92 KBIdlePASSED: [[SimpleTest]]: [MySQL] 33,358 pass(es).View details | Re-test

#4

@#1 remove trailing whitespace from patch files

Super-terrific-wonderful-great idea for a 6.x/7.x contrib module.

#5

Hm. I'm all for this patch, but I'm wondering if we should be changing
core/modules/filter/tests/filter.url-input.txt and
core/modules/filter/tests/filter.url-output.txt

I guess all of the tests passed, but I also noticed there is no newline at the end of these files, so maybe the extra spaces were intentional in some way? I'm not sure, and I would say maybe we should avoid changing those files.

#6

Re-rolled as requested.

AttachmentSizeStatusTest resultOperations
remove-trailing-whitespace-1419298-6.patch11.83 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch remove-trailing-whitespace-1419298-6.patch. Unable to apply patch. See the log in the details link for more information.View details | Re-test

#7

Status:needs review» reviewed & tested by the community

Thanks! I think this is ready to commit.

#8

Yes, looks good. This has no chance of messing up anything, so safe fix!

#9

Regenerated after multiple core commits, but the resultant patch is identical to the one in #6.

(bump!)

#10

#11

Title:Remove all trailing whitespace from Drupal core text files.» Remove all trailing whitespace from Drupal core files.
Component:documentation» other

Just a note that this affects much more than just .txt files and more than just documentation. It probably cannot be committed until the bug thresholds fall though.

#12

Assigned to:Anonymous» jhodgdon

We're under thresholds so this is back on the table again. Assigning to Jennifer, and sending for a re-test.

#13

#14

I should mention though that my /vast/ preference is to have things like this handled through http://drupal.org/project/drupalcs so they can be caught *before* the patch is uploaded to d.o.

#15

Status:reviewed & tested by the community» needs work

The last submitted patch, remove-trailing-whitespace-1419298-6.patch, failed testing.

#16

Assigned to:jhodgdon» Anonymous
Issue tags:+Novice

Unassigning so someone can reroll this patch.

#17

Status:needs work» needs review

Re-rolled.

AttachmentSizeStatusTest resultOperations
remove-trailing-whitespace-1419298-17.patch7.39 KBIdlePASSED: [[SimpleTest]]: [MySQL] 35,684 pass(es).View details | Re-test

#18

Status:needs review» needs work

The last submitted patch, remove-trailing-whitespace-1419298-17.patch, failed testing.

#19

Status:needs work» closed (won't fix)

Unsubscribing. Since there are only twelve lines changed, and I can't imagine, after a thorough review of the patch, why it would break core, I find that I just don't care anymore.

#20

Status:closed (won't fix)» active

Just because you're frustrated is not necessarily a good reason to close the issue. Sigh.

#21

Assigned to:Anonymous» pmitchell
Status:active» needs work

Rerolling (working on as part of DC2012 core sprints)

#22

Status:needs work» needs review

#17: remove-trailing-whitespace-1419298-17.patch queued for re-testing.

#23

Assigned to:pmitchell» Anonymous

Generated by the command in opening post (against the current HEAD), excludes filter/tests/filter-input-* things (which intentionally include trailing whitespace).

AttachmentSizeStatusTest resultOperations
remove-trailing-whitespace-1419298-22.patch5.73 KBIdlePASSED: [[SimpleTest]]: [MySQL] 35,699 pass(es).View details | Re-test

#24

I applied the patch in #17 to an up-to-date checkout of 8.x and ran all tests, and it came back clean. Is there any chance there was another bug in 8.x that could have caused the tests to fail on this patch?

Re-queued for testing in hopes that it comes back OK this time. It sounds like pmitchell is re-creating the patch against the current HEAD, so I'll leave that to him/her.

#25

Status:needs review» reviewed & tested by the community

Not sure why pmitchell's worked and pillarsdotnet's did not, but this latest patch looks good to me and passes tests.

#26

Status:reviewed & tested by the community» needs review

I know this one is marked to remove trailing whitespace but what about tabs? In particular the misc folder has quite a few files that have tabs instead of spaces.

I didn't know if I should open a new issue or not so please let me know.

AttachmentSizeStatusTest resultOperations
remove-trailing-whitespace-1419298-26.patch597.57 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch remove-trailing-whitespace-1419298-26.patch. Unable to apply patch. See the log in the details link for more information.View details | Re-test

#27

The current patch is a monster. To avoid making it even bigger, I would recommend handling replacing tabs with spaces in a new issue so that this one can be put to bed.

#28

Status:needs review» reviewed & tested by the community

Setting this back to RTBC. The new issue is #1513540: Replace tabs with spaces from Drupal core files..

#29

#30

Status:reviewed & tested by the community» needs work

The last submitted patch, remove-trailing-whitespace-1419298-26.patch, failed testing.

#31

Status:needs work» needs review

Reroll of #22

AttachmentSizeStatusTest resultOperations
remove-trailing-whitespace-1419298-31.patch5 KBIdlePASSED: [[SimpleTest]]: [MySQL] 36,351 pass(es).View details | Re-test
nobody click here