Merge pull request #255 from Razzeee/bump-prettify

Bump prettify dependencies and apply prettification
This commit is contained in:
Yuya Ochiai
2016-08-21 15:33:14 +09:00
committed by GitHub
8 changed files with 40 additions and 19 deletions

9
.gitattributes vendored Normal file
View File

@@ -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

View File

@@ -2,6 +2,7 @@
var gulp = require('gulp'); var gulp = require('gulp');
var prettify = require('gulp-jsbeautifier'); var prettify = require('gulp-jsbeautifier');
var diff = require('gulp-diff');
var babel = require('gulp-babel'); var babel = require('gulp-babel');
var webpack = require('webpack-stream'); var webpack = require('webpack-stream');
var named = require('vinyl-named'); var named = require('vinyl-named');
@@ -25,32 +26,41 @@ gulp.task('prettify:verify', ['prettify:sources:verify', 'prettify:jsx:verify'])
var prettify_options = { var prettify_options = {
html: { html: {
eol: '\n', indent_size: 2,
indentSize: 2 end_with_newline: true
}, },
css: { css: {
eol: '\n', indent_size: 2,
indentSize: 2 end_with_newline: true
}, },
js: { js: {
eol: '\n', indent_size: 2,
indentSize: 2, brace_style: "end-expand",
braceStyle: "end-expand" end_with_newline: true
} }
}; };
gulp.task('prettify:sources', ['sync-meta'], function() { gulp.task('prettify:sources', ['sync-meta'], function() {
prettify_options.mode = "VERIFY_AND_WRITE";
return gulp.src(sources) return gulp.src(sources)
.pipe(prettify(prettify_options)) .pipe(prettify(prettify_options))
.pipe(prettify.reporter())
.pipe(diff())
.pipe(diff.reporter({
quiet: true,
fail: false
}))
.pipe(gulp.dest('.')); .pipe(gulp.dest('.'));
}); });
gulp.task('prettify:sources:verify', function() { gulp.task('prettify:sources:verify', function() {
prettify_options.mode = "VERIFY_ONLY";
prettify_options.showDiff = false;
return gulp.src(sources) return gulp.src(sources)
.pipe(prettify(prettify_options)); .pipe(prettify(prettify_options))
.pipe(prettify.reporter())
.pipe(diff())
.pipe(diff.reporter({
quiet: true,
fail: true
}));
}); });

View File

@@ -42,17 +42,18 @@
"electron-prebuilt": "1.2.7", "electron-prebuilt": "1.2.7",
"electron-winstaller": "^2.2.0", "electron-winstaller": "^2.2.0",
"esformatter": "^0.9.6", "esformatter": "^0.9.6",
"esformatter-jsx": "^5.0.0", "esformatter-jsx": "^7.0.1",
"gulp": "^3.9.1", "gulp": "^3.9.1",
"gulp-babel": "^6.1.2", "gulp-babel": "^6.1.2",
"gulp-changed": "^1.3.2", "gulp-changed": "^1.3.2",
"gulp-diff": "^1.0.0",
"gulp-esformatter": "^6.0.0", "gulp-esformatter": "^6.0.0",
"gulp-jsbeautifier": "^1.0.1", "gulp-jsbeautifier": "^2.0.3",
"json-loader": "^0.5.4", "json-loader": "^0.5.4",
"mocha": "^3.0.2", "mocha": "^3.0.2",
"mocha-circleci-reporter": "0.0.2", "mocha-circleci-reporter": "0.0.2",
"spectron": "~3.2.0",
"rimraf": "^2.5.4", "rimraf": "^2.5.4",
"spectron": "~3.2.0",
"style-loader": "^0.13.1", "style-loader": "^0.13.1",
"through2": "^2.0.1", "through2": "^2.0.1",
"vinyl-named": "^1.1.0", "vinyl-named": "^1.1.0",

View File

@@ -40,7 +40,7 @@ const LoginModal = React.createClass({
</p> </p>
<Form horizontal onSubmit={ this.handleSubmit }> <Form horizontal onSubmit={ this.handleSubmit }>
<FormGroup> <FormGroup>
<Col componentClass={ ControlLabel } sm={ 2 }>User&nbsp;Name</Col> <Col componentClass={ ControlLabel } sm={ 2 }>User Name</Col>
<Col sm={ 10 }> <Col sm={ 10 }>
<FormControl type="text" placeholder="User Name" ref="username" /> <FormControl type="text" placeholder="User Name" ref="username" />
</Col> </Col>

View File

@@ -11,4 +11,4 @@
@font-face { @font-face {
font-family: monospace; font-family: monospace;
src: local('MS Gothic'); src: local('MS Gothic');
} }

View File

@@ -11,4 +11,4 @@
<script src="index.js"></script> <script src="index.js"></script>
</body> </body>
</html> </html>

View File

@@ -12,4 +12,4 @@
<script src="settings.js"></script> <script src="settings.js"></script>
</body> </body>
</html> </html>

View File

@@ -13,7 +13,8 @@
function open_window() { function open_window() {
window.open('./test.html'); window.open('./test.html');
} }
</script> </script>
</body> </body>
</html> </html>