From 81a6b7735b1483e8750d32f77d37806a5b9839f1 Mon Sep 17 00:00:00 2001 From: Kolja Lampe Date: Fri, 19 Aug 2016 20:15:32 +0200 Subject: [PATCH 1/3] Bump prettify dependencies and port our code to the new version --- gulpfile.js | 32 +++++++++++++++++++++----------- package.json | 7 ++++--- 2 files changed, 25 insertions(+), 14 deletions(-) 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", From 2a423e1c7e101ffb130a07d098cb2a6c54d9fd98 Mon Sep 17 00:00:00 2001 From: Kolja Lampe Date: Fri, 19 Aug 2016 22:46:31 +0200 Subject: [PATCH 2/3] Added gitattributes to keep line endings clean --- .gitattributes | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..086a4958 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto + +# Set our files to use lf, so our prettify will always be happy +*.html text eol=lf +*.css text eol=lf +*.js text eol=lf +*.jsx text eol=lf +*.json text eol=lf \ No newline at end of file From 5a5095de5487a9775927dc132dcb2c8bf880b521 Mon Sep 17 00:00:00 2001 From: Kolja Lampe Date: Sat, 20 Aug 2016 22:34:09 +0200 Subject: [PATCH 3/3] Prettified project after prettify bump --- src/browser/components/loginModal.jsx | 2 +- src/browser/css/jp_fonts.css | 2 +- src/browser/index.html | 2 +- src/browser/settings.html | 2 +- test/modules/test.html | 3 ++- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/browser/components/loginModal.jsx b/src/browser/components/loginModal.jsx index 64337272..4a1c1c0c 100644 --- a/src/browser/components/loginModal.jsx +++ b/src/browser/components/loginModal.jsx @@ -40,7 +40,7 @@ const LoginModal = React.createClass({

- User Name + User Name diff --git a/src/browser/css/jp_fonts.css b/src/browser/css/jp_fonts.css index 7b6b7f56..27e41d3c 100644 --- a/src/browser/css/jp_fonts.css +++ b/src/browser/css/jp_fonts.css @@ -11,4 +11,4 @@ @font-face { font-family: monospace; src: local('MS Gothic'); -} \ No newline at end of file +} diff --git a/src/browser/index.html b/src/browser/index.html index 74f81b95..83af62bc 100644 --- a/src/browser/index.html +++ b/src/browser/index.html @@ -12,4 +12,4 @@ - \ No newline at end of file + diff --git a/src/browser/settings.html b/src/browser/settings.html index f4ee24ef..abf4b3f8 100644 --- a/src/browser/settings.html +++ b/src/browser/settings.html @@ -12,4 +12,4 @@ - \ No newline at end of file + diff --git a/test/modules/test.html b/test/modules/test.html index 80647694..54ace824 100644 --- a/test/modules/test.html +++ b/test/modules/test.html @@ -9,7 +9,8 @@ function open_window() { window.open('./test.html'); } + - \ No newline at end of file +