Patch covers all of HEAD except modules/ and themes/. Will mark CNR once I get all of HEAD covered.

CommentFileSizeAuthor
#52 606526-rollback-D7_full.patch4.25 KBscor
#50 606526-rollback-D7.patch3.67 KBdave reid
#47 606526_combined_ends.patch54.42 KBaxyjo
#47 606526_line_ends.patch49.1 KBaxyjo
#47 606526_file_ends.patch5.31 KBaxyjo
#38 606526_axyjo_combined_ends.patch42.55 KBaxyjo
#38 606526_axyjo_file_ends.patch3.25 KBaxyjo
#38 606526_axyjo_line_ends.patch39.3 KBaxyjo
#37 606526_line_ends_37.patch38.96 KBscor
#37 606526_file_ends_37.patch3.25 KBscor
#37 606526_combined_ends_37.patch42.21 KBscor
#37 white.sh_.txt924 bytesscor
#36 file_ends_axyjo-606526-36.patch2.97 KBscor
#36 line_ends_axyjo-606526-36.patch41.66 KBscor
#36 combined_ends_axyjo-606526-36.patch44.62 KBscor
#32 file_ends_axyjo.patch2.97 KBaxyjo
#32 line_ends_axyjo.patch47.4 KBaxyjo
#32 combined_ends_axyjo.patch50.37 KBaxyjo
#30 combined_ends_axyjo.patch56.69 KBaxyjo
#28 combined_ends_axyjo_2.patch55.93 KBscor
#26 file_ends_axyjo_3.patch11.18 KBscor
#25 combined_ends_axyjo.patch55.93 KBaxyjo
#25 file_ends_axyjo.patch9.11 KBaxyjo
#25 line_ends_axyjo.patch47.05 KBaxyjo
#24 file_ends_axyjo.patch9.11 KBaxyjo
#23 file_ends_axyjo.patch11.64 KBaxyjo
#23 line_ends_axyjo.patch47.05 KBaxyjo
#23 combined_ends_axyjo.patch58.46 KBaxyjo
#21 combined_ends_axyjo.patch46.59 KBaxyjo
#21 file_ends_axyjo.patch5.5 KBaxyjo
#21 line_ends_axyjo.patch41.09 KBaxyjo
#18 clean_up_lines_axyjo_606526_3.patch688.5 KBaxyjo
#15 clean_up_lines_axyjo_606526_2.patch688.59 KBaxyjo
#13 clean_up_lines_axyjo_606526.patch693.35 KBaxyjo
#11 remove_trailing_spaces_3.patch41.09 KBscor
#11 strip_trail_spaces3.sh_.txt251 bytesscor
#10 remove_trailing_spaces_2.patch40.3 KBscor
#10 strip_trail_spaces2.sh_.txt246 bytesscor
#6 remove_trailing_spaces_1.patch29.43 KBscor
#6 strip_trail_spaces.sh_.txt163 bytesscor
#3 drupal_whitespace-axyjo.patch465.37 KBaxyjo
#1 drupal_whitespace-axyjo.patch402.63 KBaxyjo
drupal_whitespace-axyjo.patch379.4 KBaxyjo

Comments

axyjo’s picture

Status: Needs work » Needs review
StatusFileSize
new402.63 KB

All of HEAD covered.

Status: Needs review » Needs work

The last submitted patch failed testing.

axyjo’s picture

Status: Needs work » Needs review
StatusFileSize
new465.37 KB

Using the right CVS diff options would probably help with getting the patch to apply.

dries’s picture

I'll commit this as soon the code is frozen. Don't want to inadvertently break other patches because of this.

Status: Needs review » Needs work

The last submitted patch failed testing.

scor’s picture

Status: Needs work » Needs review
StatusFileSize
new163 bytes
new29.43 KB

This patch removes all the trailing spaces from HEAD. script included.

yched’s picture

Status: Needs review » Reviewed & tested by the community

/me dreams of an automated trailing space removal on commit - or of a test that would reject any patch with trailing spaces.

scor’s picture

@yched I have the feeling a lightweight coder-like script might be part of PIFR 2, well, at least I hope so :)

webchick’s picture

Status: Reviewed & tested by the community » Fixed

This oughtta make some people cranky. ;) But hey, it is after code freeze, so... committed to HEAD! ;)

scor’s picture

Status: Fixed » Needs review
StatusFileSize
new246 bytes
new40.3 KB

I forgot to include *.inc and *.php file in my first script. patch against HEAD and updated script attached.

scor’s picture

StatusFileSize
new251 bytes
new41.09 KB

now with *.js (toolbar.js got caught).

axyjo’s picture

This script should ideally go into the testbot's list of things to check. It'd help with Dries' implementation of step 7 here http://buytaert.net/8-steps-for-drupal-8

axyjo’s picture

StatusFileSize
new693.35 KB

Here's an updated patch and script that checks for newlines at the end of files as well.

#!/bin/bash
for ext in "info" "css" "txt" "sh" "profile" "install" "test" "module" "inc" "php" "js"
do
  find . -type f -name "*.$ext" -exec sed -i 's/[[:space:]]*$//' {} \;
  find . -type f -name "*.$ext" -exec sed -i '${/^$/!s/$/\
/;}' {} \;
done

Status: Needs review » Needs work

The last submitted patch failed testing.

axyjo’s picture

Status: Needs work » Needs review
StatusFileSize
new688.59 KB

Added the --no-prefix option so that it'll work now.

Status: Needs review » Needs work

The last submitted patch failed testing.

scor’s picture

@axyjo : make sure to not include any change to misc/ui/* since there are libraries and we are not altering these... (git checkout misc/ui/ before rolling the patch)

splitting (1) trailing spaces and (2) newline at end of files into two patches might be a good idea as it would help a lot with patches reviews.

axyjo’s picture

Status: Needs work » Needs review
StatusFileSize
new688.5 KB

Here's a patch that should hopefully work, thanks to DamZ on IRC. Rolled against the git mirror of the cvs repository instead of a local git project created after checking out HEAD from cvs.

axyjo’s picture

Status: Needs review » Needs work

Good idea, #17. Didn't refresh the page before I hit submit, so I'll reroll now with two distinct patches.

scor’s picture

@axyjo: re newlines at end of files, files which already have a new line at the end get an extra new line.

So I agree with hunks like

diff --git modules/field/modules/text/text.info modules/field/modules/text/text.info
index 608e304..7b01229 100644
--- modules/field/modules/text/text.info
+++ modules/field/modules/text/text.info
@@ -6,4 +6,5 @@ version = VERSION
 core = 7.x
 files[] = text.module
 files[] = text.test
-required = TRUE
\ No newline at end of file
+required = TRUE
+

but not

diff --git modules/field/modules/text/text.js modules/field/modules/text/text.js
index 7397a8d..ea3bdac 100644
--- modules/field/modules/text/text.js
+++ modules/field/modules/text/text.js
@@ -38,3 +38,4 @@ Drupal.behaviors.textTextareaSummary = {
 };
 
 })(jQuery);
+

text.js has now 2 newlines in the end.

EDIT: gdiff | grep "No newline at end of file" | wc -l returns 15 so it should be quick to select these hunks from the patch and discard all the others; or modify the script to take this into account ;)

axyjo’s picture

StatusFileSize
new41.09 KB
new5.5 KB
new46.59 KB

Got it :D. Drastically reduces the size of the patch as well. Two separate patches posted for review, the combined patch is for committing purposes. I also updated the script a bit, so that's here as well.

Script assumes you've got a git clone of the repo in the drupal subdirectory in your current working path.

#!/bin/bash

cd drupal/
git checkout .

for ext in "info" "css" "txt" "sh" "profile" "install" "test" "module" "inc" "php" "js"
do
  find . -type f -name "*.$ext" -exec sed -i 's/[[:space:]]*$//' {} \;
done
git checkout misc/ui/
git status
git diff --no-prefix > ../line_ends_axyjo.patch

#clean up directory for new patch.
git checkout .
git status

for ext in "info" "css" "txt" "sh" "profile" "install" "test" "module" "inc" "php" "js"
do
  find . -type f -name "*.$ext" -print | xargs printf "e %s\nw\n" | ed -s;
done
git checkout misc/ui/
git status
git diff --no-prefix > ../file_ends_axyjo.patch

#clean up directory for new patch.
git checkout .
git status

for ext in "info" "css" "txt" "sh" "profile" "install" "test" "module" "inc" "php" "js"
do
  find . -type f -name "*.$ext" -exec sed -i 's/[[:space:]]*$//' {} \;
  find . -type f -name "*.$ext" -print | xargs printf "e %s\nw\n" | ed -s;
done
git checkout misc/ui/
git status
git diff --no-prefix > ../combined_ends_axyjo.patch

cd ..
#rm -rf drupal/
axyjo’s picture

Status: Needs work » Needs review

Forgot this.

axyjo’s picture

StatusFileSize
new58.46 KB
new47.05 KB
new11.64 KB

Here it is, updated based on the latest HEAD.

axyjo’s picture

StatusFileSize
new9.11 KB

Hmm. I wonder if reverting the modules/simpletest/files directory will help the file ends patch pass. Here are the patches when those files are excluded. Line ends patch remains the same, so it isn't uploaded this time around. Since the combined patch has both of them, I'll just upload the file ends patch. Updated script:

#!/bin/bash

cd drupal/
git checkout .

for ext in "info" "css" "txt" "sh" "profile" "install" "test" "module" "inc" "php" "js"
do
  find . -type f -name "*.$ext" -exec sed -i 's/[[:space:]]*$//' {} \;
done
git checkout misc/ui/
git status
git diff --no-prefix > ../line_ends_axyjo.patch

#clean up directory for new patch.
git checkout .
git status

for ext in "info" "css" "txt" "sh" "profile" "install" "test" "module" "inc" "php" "js"
do
  find . -type f -name "*.$ext" -print | xargs printf "e %s\nw\n" | ed -s;
done
git checkout misc/ui/
git checkout modules/simpletest/files/
git status
git diff --no-prefix > ../file_ends_axyjo.patch

#clean up directory for new patch.
git checkout .
git status

for ext in "info" "css" "txt" "sh" "profile" "install" "test" "module" "inc" "php" "js"
do
  find . -type f -name "*.$ext" -exec sed -i 's/[[:space:]]*$//' {} \;
  find . -type f -name "*.$ext" -print | xargs printf "e %s\nw\n" | ed -s;
done
git checkout misc/ui/
git checkout modules/simpletest/files/
git status
git diff --no-prefix > ../combined_ends_axyjo.patch

cd ..
#rm -rf drupal/

axyjo’s picture

StatusFileSize
new47.05 KB
new9.11 KB
new55.93 KB

Awesome! Since that script got the green light from the testbot, here are the files again. file_ends and line_ends are just for the reviewer's sake and the actual file to patch/commit with is combined_ends.

scor’s picture

StatusFileSize
new11.18 KB

please ignore this patch for now, I'm just trying to see if we can get more of the test files cleaned up. It's fair to leave the css_input_without_import.css.optimized.css as it is since it's the output of drupal_load_stylesheet(). Also found modules/simpletest/files/html-2.html (the html extension was not in the script, and that's the only .html file in HEAD).
EDIT: can't reproduce the failing UploadTestCase on my localhost.

Status: Needs review » Needs work

The last submitted patch failed testing.

scor’s picture

Status: Needs work » Needs review
StatusFileSize
new55.93 KB

Nevermind. Reuploading the combined patch from #25

brianV’s picture

Status: Needs review » Reviewed & tested by the community

It all looks good to me, and the testbots are greenlighting it.

I think this is RTBC.

axyjo’s picture

StatusFileSize
new56.69 KB

Updated patch. Left at RTBC since both brianV and scor have looked at it.

scor’s picture

Status: Reviewed & tested by the community » Needs work
@@ -3,9 +3,9 @@
 /*
  * jQuery BBQ: Back Button & Query Library - v1.0.2 - 10/10/2009
  * http://benalman.com/projects/jquery-bbq-plugin/
- * 
+ *
  * Copyright (c) 2009 "Cowboy" Ben Alman
  * Dual licensed under the MIT and GPL licenses.
  * http://benalman.com/about/license/
  */
-(function($,c){var g,k=document.location,i=Array.prototype.slice,E=...
\ No newline at end of file
+(function($,c){var g,k=document.location,i=Array.prototype.slice,E=...

This is a library so I'm not sure we should alter it.

axyjo’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new50.37 KB
new47.4 KB
new2.97 KB

Agreed. Added an exception to jQuery files in the script. Here's the patch without it.

#!/bin/bash

cd drupal/
git checkout .

for ext in "info" "css" "txt" "sh" "profile" "install" "test" "module" "inc" "php" "js"
do
  find . -type f -name "*.$ext" -exec sed -i 's/[[:space:]]*$//' {} \;
done
git checkout misc/ui/
git checkout misc/jquery.*
git status
git diff --no-prefix > ../line_ends_axyjo.patch

#clean up directory for new patch.
git checkout .
git status

for ext in "info" "css" "txt" "sh" "profile" "install" "test" "module" "inc" "php" "js"
do
  find . -type f -name "*.$ext" -print | xargs printf "e %s\nw\n" | ed -s;
done
git checkout misc/ui/
git checkout modules/simpletest/files/
git checkout misc/jquery.*
git status
git diff --no-prefix > ../file_ends_axyjo.patch

#clean up directory for new patch.
git checkout .
git status

for ext in "info" "css" "txt" "sh" "profile" "install" "test" "module" "inc" "php" "js"
do
  find . -type f -name "*.$ext" -exec sed -i 's/[[:space:]]*$//' {} \;
  find . -type f -name "*.$ext" -print | xargs printf "e %s\nw\n" | ed -s;
done
git checkout misc/ui/
git checkout modules/simpletest/files/
git checkout misc/jquery.*
git status
git diff --no-prefix > ../combined_ends_axyjo.patch

cd ..
#rm -rf drupal/
scor’s picture

looks good.

Status: Reviewed & tested by the community » Needs review

scor requested that failed test be re-tested.

Status: Needs review » Needs work

The last submitted patch failed testing.

scor’s picture

Title: Remove trailing whitespace and add newlines at end of file » Remove trailing whitespaces and add newlines at end of files
Status: Needs work » Needs review
StatusFileSize
new44.62 KB
new41.66 KB
new2.97 KB

rerolled

scor’s picture

StatusFileSize
new924 bytes
new42.21 KB
new3.25 KB
new38.96 KB

rerolled patches (including script).

axyjo’s picture

Rerolled patch with scor's new script.

dave reid’s picture

Issue tags: +Coding standards

Adding tag and subscribing...

boombatower’s picture

Status: Needs review » Reviewed & tested by the community

Lets get this in, looks good (simple).

Part of #666022: [meta issue] Style cleanup.

dries’s picture

Can we extend this script to deal with #516576: Convert CRLF to LF in all jquery ui files as well? I'd rather run such a script locally, than accept a monster patch where it is hard to verify all the changes. Just askin' ... :)

scor’s picture

Since the jQuery UI files are external libraries, I don't think we should modify them in any way, and that's why the script in this issue ignores misc/ui/ and misc/jquery.*. Is there any performance improvement in changing CRLF to LF other than saving one char per line and complying with our coding standards?

axyjo’s picture

Aren't all jQuery libs basically 1 LOC due to compression/packer? So that's upto 20 lines total in a file. 20 bytes saved by changing CRLF to LF times 41 (number of jQuery files in misc/ and misc/ui/) = 820 bytes saved overall. Is it really worth it in terms of file size?

+ scor brings up a good issue about jQuery being an external library.

scor’s picture

http://drupal.org/coding-standards does not specify whether our coding standards should apply to external libraries as well. I believe it should not but let's see what other people think.

axyjo’s picture

Agreed with scor. This reduces our work since we don't have to patch the files every single time an external library updates (even though we freeze the version in our tree).

axyjo’s picture

Priority: Minor » Normal
Status: Reviewed & tested by the community » Needs work

With coder integration now in the test bot, I really think that this should be fixed ASAP. Bumping the priority up and bumping the status down until I do a re-roll.

axyjo’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new5.31 KB
new49.1 KB
new54.42 KB

Here's that re-roll I promised. Setting back to RTBC since it's the same script that's used.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD.

scor’s picture

see follow up patch for dreditor #656456: Auto-detect trailing white-space and missing EOF newline in patch review so we don't have to reopen this issue again...

dave reid’s picture

StatusFileSize
new3.67 KB

The changes to UnicodeTest.txt are causing the current HEAD failures since two lines had their characters removed.
http://drupalcode.org/viewvc/drupal/drupal/modules/search/tests/UnicodeT...
http://qa.drupal.org/pifr/test/32

Rolling back the changes to UnicodeTest.txt puts me back to 1 fail with Search simplify test.

dave reid’s picture

Title: Remove trailing whitespaces and add newlines at end of files » [Needs rollback] Remove trailing whitespaces and add newlines at end of files
Priority: Normal » Critical
Status: Fixed » Needs work
scor’s picture

Status: Needs work » Needs review
Issue tags: +HEAD broken
StatusFileSize
new4.25 KB

full reroll of Unicodetest.txt, which solves all 3 failures of the Search simplify test.

The file UnicodeTest.txt was introduced after the last time the testbot ran the tests sucessfully on patch #38. For some reason the testbot didn't report back on the previous patch #47.

catch’s picture

Status: Needs review » Reviewed & tested by the community

(note to anyone who thinks the patch is broken, Drupal.org thinks patch files are iso-something, if you manually change to utf-8 in your browse it'll look fine).

webchick’s picture

Issue tags: -HEAD broken

Committed. Thanks!

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Er. That. :)

Status: Fixed » Closed (fixed)
Issue tags: -Coding standards

Automatically closed -- issue fixed for 2 weeks with no activity.