ripple-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject incubator-ripple git commit: Fix fixwhitespace task.
Date Thu, 18 Jun 2015 18:58:46 GMT
Repository: incubator-ripple
Updated Branches:
  refs/heads/master 379d630da -> 5df827fb4


Fix fixwhitespace task.

When a Windows user uses git with `core.autocrlf` option, the files are checked out using
Windows line-endings and converted back to `\n` on commit. The regular expression corrected
wouldn't catch trailing spaces on lines with `\r\n`. Instead, let the regexp engine to care
of line-endings using multiline regex and end-of-line.

Also, check build files.

This closes #56


Project: http://git-wip-us.apache.org/repos/asf/incubator-ripple/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ripple/commit/5df827fb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ripple/tree/5df827fb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ripple/diff/5df827fb

Branch: refs/heads/master
Commit: 5df827fb40a254a8a8b6a60a58202026fe0912d0
Parents: 379d630
Author: Arzhan Kinzhalin <arzhan.i.kinzhalin@intel.com>
Authored: Fri May 15 02:48:45 2015 -0300
Committer: Tim Barham <tim.barham@microsoft.com>
Committed: Thu Jun 18 11:56:48 2015 -0700

----------------------------------------------------------------------
 build/whitespace.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ripple/blob/5df827fb/build/whitespace.js
----------------------------------------------------------------------
diff --git a/build/whitespace.js b/build/whitespace.js
index 653f0f5..9e91699 100644
--- a/build/whitespace.js
+++ b/build/whitespace.js
@@ -29,7 +29,7 @@ var fs = require('fs'),
     path = require("path"),
     rexp_minified = new RegExp("\\.min\\.js$"),
     rexp_src = new RegExp('\\.js$'),
-    _targets = ['lib'];
+    _targets = ['lib', 'build'];
 
 function forEachFile(root, cbFile, cbDone) {
     var count = 0;
@@ -81,7 +81,7 @@ function processWhiteSpace(processor, done) {
                 }
 
                 // eliminate trailing white space
-                src = src.replace(/ +\n/g, '\n');
+                src = src.replace(/[ ]+$/mg, '');
 
                 if (origsrc !== src) {
                     // write it out yo


Mime
View raw message