From 2a95098f7d90c1d56b1ca87957ac879405145c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Krzto=C5=84?= Date: Mon, 16 Jan 2017 11:28:06 +0100 Subject: [PATCH 1/3] Updated David-dm badge link. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 228de872460..e085390ee51 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # CKEditor 4 - The best browser-based WYSIWYG editor -[![devDependency Status](https://david-dm.org/ckeditor/ckeditor-dev/dev-status.svg)](https://david-dm.org/ckeditor/ckeditor-dev#info=devDependencies) +[![devDependencies Status](https://david-dm.org/ckeditor/ckeditor-dev/dev-status.svg)](https://david-dm.org/ckeditor/ckeditor-dev?type=dev) This repository contains the development version of CKEditor. From ab343ec5348824064e1122d6f51b0eb75365f1be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Krzto=C5=84?= Date: Mon, 16 Jan 2017 11:31:55 +0100 Subject: [PATCH 2/3] Update dependencies. --- .jscsrc | 4 ++-- .jshintrc | 2 +- dev/tasks/utils/tools.js | 11 ++++------- gruntfile.js | 3 ++- package.json | 8 ++++---- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.jscsrc b/.jscsrc index 6ef3812a9cc..5e51b095cb2 100644 --- a/.jscsrc +++ b/.jscsrc @@ -53,6 +53,6 @@ }, "validateIndentation": { "value": "\t", - "allExcept": [ "comments" ] + "allExcept": [ "comments", "emptyLines" ] } -} \ No newline at end of file +} diff --git a/.jshintrc b/.jshintrc index e9e03185d54..29d68da86b4 100644 --- a/.jshintrc +++ b/.jshintrc @@ -22,4 +22,4 @@ "validthis": true, "predef": [ "CKEDITOR", "assert", "arrayAssert", "bender", "JSON", "objectAssert", "resume", "sinon", "wait", "YUITest" ] -} \ No newline at end of file +} diff --git a/dev/tasks/utils/tools.js b/dev/tasks/utils/tools.js index cd057cb64d0..dbacf5732a9 100644 --- a/dev/tasks/utils/tools.js +++ b/dev/tasks/utils/tools.js @@ -125,18 +125,15 @@ module.exports = { * @returns {String} The command output. */ shExec: function( command ) { - var sh = require( 'shelljs' ); - sh.config.silent = true; - - var ret = sh.exec( command ); + var sh = require( 'shelljs' ), + ret = sh.exec( command, { silent: true } ); if ( ret.code ) { throw new Error( 'Error while executing `' + command + '`:\n\n' + - ret.output + ret.stdout ); } - - return ret.output; + return ret.stdout; } }; diff --git a/gruntfile.js b/gruntfile.js index 631cd6401be..1c60a6f062f 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -18,7 +18,8 @@ module.exports = function( grunt ) { 'samples/toolbarconfigurator/lib/**', 'tests/adapters/jquery/_assets/**', 'tests/core/dom/_assets/**', - 'tests/core/selection/_helpers/rangy.js' + 'tests/core/selection/_helpers/rangy.js', + 'tests/plugins/pastefromword/generated/_lib/q.js' ]; // Basic configuration which will be overloaded by the tasks. diff --git a/package.json b/package.json index fd822d63890..c1979533911 100644 --- a/package.json +++ b/package.json @@ -9,17 +9,17 @@ "benderjs-sinon": "^0.3.1", "benderjs-yui": "^0.3.2", "benderjs-yui-beautified": "0.0.5", - "grunt": "^0", + "grunt": "^1.0.1", "grunt-contrib-imagemin": "^1.0.0", - "grunt-jscs": "^2.0.0", + "grunt-jscs": "^3.0.1", "grunt-contrib-jshint": "^1.0.0", "grunt-contrib-less": "^1.0.0", "grunt-contrib-watch": "^1.0.0", "grunt-contrib-concat": "^1.0.0", "grunt-jsduck": "^1.0.1", - "grunt-githooks": "^0.5.0", + "grunt-githooks": "^0.6.0", "less": "^2.5.0", - "shelljs": "~0.6", + "shelljs": "^0.7.6", "cksource-samples-framework": "^1.0.1" }, "scripts": { From 18c3a124e78210df109301e806cac9babcfd5e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Krzto=C5=84?= Date: Mon, 16 Jan 2017 11:34:21 +0100 Subject: [PATCH 3/3] Apply pre-commit hook (jshint and jscs validation) only on staged files. --- dev/tasks/jscs.js | 2 +- dev/tasks/jshint.js | 2 +- dev/tasks/utils/tools.js | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dev/tasks/jscs.js b/dev/tasks/jscs.js index 08abe2dc348..99853307c30 100644 --- a/dev/tasks/jscs.js +++ b/dev/tasks/jscs.js @@ -15,7 +15,7 @@ module.exports = function( grunt ) { }, git: function() { - return tools.getGitDirtyFiles().filter( function( file ) { + return tools.getGitDirtyFiles( true ).filter( function( file ) { return ( /\.js$/ ).test( file ); } ); } diff --git a/dev/tasks/jshint.js b/dev/tasks/jshint.js index e7642fa1e2e..4549c5b20bb 100644 --- a/dev/tasks/jshint.js +++ b/dev/tasks/jshint.js @@ -15,7 +15,7 @@ module.exports = function( grunt ) { }, git: function() { - return tools.getGitDirtyFiles().filter( function( file ) { + return tools.getGitDirtyFiles( true ).filter( function( file ) { return ( /\.js$/ ).test( file ); } ); } diff --git a/dev/tasks/utils/tools.js b/dev/tasks/utils/tools.js index dbacf5732a9..ae4b0ed40e8 100644 --- a/dev/tasks/utils/tools.js +++ b/dev/tasks/utils/tools.js @@ -96,14 +96,15 @@ module.exports = { /** * Gets the list of files that are supposed to be included in the next Git commit. * + * @param cachedOnly {Boolean} List only files which are staged. * @returns {String[]} A list of file paths. */ - getGitDirtyFiles: function() { + getGitDirtyFiles: function( cachedOnly ) { // Cache it, so it is executed only once when running multiple tasks. if ( !dirtyFiles ) { dirtyFiles = this // Compare the state of index with HEAD. - .shExec( 'git diff-index --name-only HEAD' ) + .shExec( 'git diff-index --name-only ' + ( cachedOnly ? '--cached HEAD' : 'HEAD' ) ) // Remove trailing /n to avoid an empty entry. .replace( /\s*$/, '' ) // Transform into array.