diff --git a/gulpfile.js b/gulpfile.js index 90ab2fd0..557cd635 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2,6 +2,7 @@ var gulp = require('gulp'); var prettify = require('gulp-jsbeautifier'); +var diff = require('gulp-diff'); var babel = require('gulp-babel'); var webpack = require('webpack-stream'); var named = require('vinyl-named'); @@ -25,32 +26,41 @@ gulp.task('prettify:verify', ['prettify:sources:verify', 'prettify:jsx:verify']) var prettify_options = { html: { - eol: '\n', - indentSize: 2 + indent_size: 2, + end_with_newline: true }, css: { - eol: '\n', - indentSize: 2 + indent_size: 2, + end_with_newline: true }, js: { - eol: '\n', - indentSize: 2, - braceStyle: "end-expand" + indent_size: 2, + brace_style: "end-expand", + end_with_newline: true } }; gulp.task('prettify:sources', ['sync-meta'], function() { - prettify_options.mode = "VERIFY_AND_WRITE"; return gulp.src(sources) .pipe(prettify(prettify_options)) + .pipe(prettify.reporter()) + .pipe(diff()) + .pipe(diff.reporter({ + quiet: true, + fail: false + })) .pipe(gulp.dest('.')); }); gulp.task('prettify:sources:verify', function() { - prettify_options.mode = "VERIFY_ONLY"; - prettify_options.showDiff = false; return gulp.src(sources) - .pipe(prettify(prettify_options)); + .pipe(prettify(prettify_options)) + .pipe(prettify.reporter()) + .pipe(diff()) + .pipe(diff.reporter({ + quiet: true, + fail: true + })); }); diff --git a/package.json b/package.json index c8e6c510..7558166e 100644 --- a/package.json +++ b/package.json @@ -42,17 +42,18 @@ "electron-prebuilt": "1.2.7", "electron-winstaller": "^2.2.0", "esformatter": "^0.9.6", - "esformatter-jsx": "^5.0.0", + "esformatter-jsx": "^7.0.1", "gulp": "^3.9.1", "gulp-babel": "^6.1.2", "gulp-changed": "^1.3.2", + "gulp-diff": "^1.0.0", "gulp-esformatter": "^6.0.0", - "gulp-jsbeautifier": "^1.0.1", + "gulp-jsbeautifier": "^2.0.3", "json-loader": "^0.5.4", "mocha": "^2.3.4", "mocha-circleci-reporter": "0.0.2", - "spectron": "~3.2.0", "rimraf": "^2.5.4", + "spectron": "~3.2.0", "style-loader": "^0.13.1", "through2": "^2.0.1", "vinyl-named": "^1.1.0",