From d7ead2aa5c9cc3aebc98c8e350913765af784285 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Sun, 9 Oct 2016 20:33:59 +0200 Subject: [PATCH] Style with jscs. --- Gruntfile.js | 6 ++-- grunt-config/connect.js | 54 +++++++++++++++++------------------ grunt-config/copy.js | 28 +++++++++--------- grunt-config/filerev.js | 26 ++++++++--------- grunt-config/htmllint.js | 24 ++++++++-------- grunt-config/includeSource.js | 16 +++++------ grunt-config/jscs.js | 2 +- grunt-config/jshint.js | 2 +- grunt-config/ngAnnotate.js | 12 ++++---- grunt-config/shell.js | 6 ++-- grunt-config/usemin.js | 22 +++++++------- grunt-config/useminPrepare.js | 24 ++++++++-------- grunt-config/watch.js | 18 ++++++------ 13 files changed, 120 insertions(+), 120 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 95dc779..2ac3285 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -26,9 +26,9 @@ module.exports = function(grunt) { grunt.initConfig(configs); grunt.registerTask('dependencies', [ - 'shell:npm_install', - 'shell:bower_install', - 'shell:pip_install', + 'shell:npmInstall', + 'shell:bowerInstall', + 'shell:pipInstall', 'wiredep:app' ]); diff --git a/grunt-config/connect.js b/grunt-config/connect.js index 563a67a..27b2a8c 100644 --- a/grunt-config/connect.js +++ b/grunt-config/connect.js @@ -2,39 +2,39 @@ module.exports = { options: { - port: 5001, - hostname: 'localhost', - base: '<%= accountant.frontend.src %>', - apiUrl: 'http://localhost:5000/api/', - swaggerUiUrl: 'http://localhost:5000/swaggerui/', - livereload: 1337, + port: 5001, + hostname: 'localhost', + base: '<%= accountant.frontend.src %>', + apiUrl: 'http://localhost:5000/api/', + swaggerUiUrl: 'http://localhost:5000/swaggerui/', + livereload: 1337 }, proxies: [{ - context: '/api', - host: '127.0.0.1', - port: 5000, - https: false + context: '/api', + host: '127.0.0.1', + port: 5000, + https: false }, { - contect: '/swaggerui', - host: '127.0.0.1', - port: 5000, - https: false + contect: '/swaggerui', + host: '127.0.0.1', + port: 5000, + https: false }], livereload: { - options: { - //open: true, - middleware: function(connect, options, middlewares) { - var connectLogger = require('connect-logger'); - var connectProxy = require('connect-proxy-layer'); - var apiProxy = connectProxy(options.apiUrl); - var swaggerUiProxy = connectProxy(options.swaggerUiUrl); + options: { + //open: true, + middleware: function(connect, options, middlewares) { + var connectLogger = require('connect-logger'); + var connectProxy = require('connect-proxy-layer'); + var apiProxy = connectProxy(options.apiUrl); + var swaggerUiProxy = connectProxy(options.swaggerUiUrl); - return [ - connectLogger(), - connect().use('/api', apiProxy), - connect().use('/swaggerUi', swaggerUiProxy), - ].concat(middlewares); + return [ + connectLogger(), + connect().use('/api', apiProxy), + connect().use('/swaggerUi', swaggerUiProxy) + ].concat(middlewares); + } } - } } }; diff --git a/grunt-config/copy.js b/grunt-config/copy.js index 388ee5e..afa9f97 100644 --- a/grunt-config/copy.js +++ b/grunt-config/copy.js @@ -2,21 +2,21 @@ module.exports = { dist: { - files: [{ - expand: true, - dot: true, - cwd: '<%= accountant.frontend.src %>', - dest: '<%= accountant.frontend.dist %>', - src :[ - '*.html', - 'views/*.html', - ] - }] + files: [{ + expand: true, + dot: true, + cwd: '<%= accountant.frontend.src %>', + dest: '<%= accountant.frontend.dist %>', + src: [ + '*.html', + 'views/*.html' + ] + }] }, styles: { - expand: true, - cwd: '<%= accountant.frontend.src %>/css', - dest: '.tmp/css', - src: '{,*/}*.css' + expand: true, + cwd: '<%= accountant.frontend.src %>/css', + dest: '.tmp/css', + src: '{,*/}*.css' } }; diff --git a/grunt-config/filerev.js b/grunt-config/filerev.js index e6448db..98eb15c 100644 --- a/grunt-config/filerev.js +++ b/grunt-config/filerev.js @@ -1,17 +1,17 @@ 'use strict'; module.exports = { - options: { - encoding: 'utf-8', - algorithm: 'md5', - length: 8 - }, - dist: { - src: [ - '<%= accountant.frontend.dist %>/css/*.css', - '<%= accountant.frontend.dist %>/js/*.js', - '!<%= accountant.frontend.dist %>/css/*.map.css', - '!<%= accountant.frontend.dist %>/js/*.map.js' - ] - }, + options: { + encoding: 'utf-8', + algorithm: 'md5', + length: 8 + }, + dist: { + src: [ + '<%= accountant.frontend.dist %>/css/*.css', + '<%= accountant.frontend.dist %>/js/*.js', + '!<%= accountant.frontend.dist %>/css/*.map.css', + '!<%= accountant.frontend.dist %>/js/*.map.js' + ] + } }; diff --git a/grunt-config/htmllint.js b/grunt-config/htmllint.js index fd4d04f..ece331f 100644 --- a/grunt-config/htmllint.js +++ b/grunt-config/htmllint.js @@ -1,16 +1,16 @@ module.exports = { frontend: { - options: { - 'attr-name-style': 'dash', - 'attr-req-value': false, - 'id-class-ignore-regex': '{{.*?}}', - 'id-class-style': 'dash', - 'indent-style': 'spaces', - 'indent-width': 2 - }, - src: [ - '<%= accountant.frontend.src %>/*.html', - '<%= accountant.frontend.src %>/views/*.html' - ] + options: { + 'attr-name-style': 'dash', + 'attr-req-value': false, + 'id-class-ignore-regex': '{{.*?}}', + 'id-class-style': 'dash', + 'indent-style': 'spaces', + 'indent-width': 2 + }, + src: [ + '<%= accountant.frontend.src %>/*.html', + '<%= accountant.frontend.src %>/views/*.html' + ] } }; diff --git a/grunt-config/includeSource.js b/grunt-config/includeSource.js index c61102c..dd4c89c 100644 --- a/grunt-config/includeSource.js +++ b/grunt-config/includeSource.js @@ -1,13 +1,13 @@ 'use strict'; module.exports = { - options: { - basePath: '<%= accountant.frontend.src %>', - baseUrl: '' - }, - index: { - files: { - '<%= accountant.frontend.src %>/index.html': '<%= accountant.frontend.src %>/index.html' + options: { + basePath: '<%= accountant.frontend.src %>', + baseUrl: '' + }, + index: { + files: { + '<%= accountant.frontend.src %>/index.html': '<%= accountant.frontend.src %>/index.html' + } } - } }; diff --git a/grunt-config/jscs.js b/grunt-config/jscs.js index 35961e9..09ac60b 100644 --- a/grunt-config/jscs.js +++ b/grunt-config/jscs.js @@ -2,7 +2,7 @@ module.exports = { options: { config: '.jscsrc' }, - frontend_js: [ + frontendJs: [ '<%= accountant.frontend.src %>/js/*.js' ], toolchain: [ diff --git a/grunt-config/jshint.js b/grunt-config/jshint.js index 1cbf45a..3ef39b6 100644 --- a/grunt-config/jshint.js +++ b/grunt-config/jshint.js @@ -3,7 +3,7 @@ module.exports = { jshintrc: '.jshintrc', reporter: require('jshint-stylish') }, - frontend_js: [ + frontendJs: [ '<%= accountant.frontend.src %>/js/*.js' ], toolchain: [ diff --git a/grunt-config/ngAnnotate.js b/grunt-config/ngAnnotate.js index 1d11f06..3b65d8c 100644 --- a/grunt-config/ngAnnotate.js +++ b/grunt-config/ngAnnotate.js @@ -2,11 +2,11 @@ module.exports = { dist: { - files: [{ - expand: true, - cwd: '.tmp/concat/js', - src: '*.js', - dest: '.tmp/concat/js' - }] + files: [{ + expand: true, + cwd: '.tmp/concat/js', + src: '*.js', + dest: '.tmp/concat/js' + }] } }; diff --git a/grunt-config/shell.js b/grunt-config/shell.js index 711f607..5f99163 100644 --- a/grunt-config/shell.js +++ b/grunt-config/shell.js @@ -1,11 +1,11 @@ module.exports = { - npm_install: { + npmInstall: { command: 'npm install' }, - bower_install: { + bowerInstall: { command: 'bower install' }, - pip_install: { + pipInstall: { command: 'pip install --upgrade --requirement requirements.txt' } }; diff --git a/grunt-config/usemin.js b/grunt-config/usemin.js index 2c956d2..ceecf82 100644 --- a/grunt-config/usemin.js +++ b/grunt-config/usemin.js @@ -1,16 +1,16 @@ 'use strict'; module.exports = { - html: ['<%= accountant.frontend.dist %>/{,*/}*.html'], - css: ['<%= accountant.frontend.dist %>/css/{,*/}*.css'], - js: ['<%= accountant.frontend.dist %>/js/{,*/}*.js'], - options: { - assetsDir: [ - '<%= accountant.frontend.dist %>', - '<%= accountant.frontend.dist %>/css', - ], - patterns: { - js: [[/(images\/[^''""]*\.(png|jpg|jpeg|gif|webp|svg))/g, 'Replacing references to images']] + html: ['<%= accountant.frontend.dist %>/{,*/}*.html'], + css: ['<%= accountant.frontend.dist %>/css/{,*/}*.css'], + js: ['<%= accountant.frontend.dist %>/js/{,*/}*.js'], + options: { + assetsDir: [ + '<%= accountant.frontend.dist %>', + '<%= accountant.frontend.dist %>/css' + ], + patterns: { + js: [[/(images\/[^''""]*\.(png|jpg|jpeg|gif|webp|svg))/g, 'Replacing references to images']] + } } - } }; diff --git a/grunt-config/useminPrepare.js b/grunt-config/useminPrepare.js index 00d5f55..ebe86df 100644 --- a/grunt-config/useminPrepare.js +++ b/grunt-config/useminPrepare.js @@ -1,17 +1,17 @@ 'use strict'; module.exports = { - html: '<%= accountant.frontend.src %>/index.html ', - options: { - dest: '<%= accountant.frontend.dist %>', - flow: { - html: { - steps: { - js: ['concat', 'uglify'], - css: ['cssmin'] - }, - post: {} - } + html: '<%= accountant.frontend.src %>/index.html ', + options: { + dest: '<%= accountant.frontend.dist %>', + flow: { + html: { + steps: { + js: ['concat', 'uglify'], + css: ['cssmin'] + }, + post: {} + } + } } - } }; diff --git a/grunt-config/watch.js b/grunt-config/watch.js index 3955edc..156ec79 100644 --- a/grunt-config/watch.js +++ b/grunt-config/watch.js @@ -27,17 +27,17 @@ module.exports = { files: ['Gruntfile.js', 'grunt-config/*.js'] }, livereload: { - options: { - livereload: '<%= connect.options.livereload %>' - }, - files: [ - '<%= accountant.frontend.src %>/{,*/}*.html', - '<%= accountant.frontend.src %>/js/*.js', - '<%= accountant.frontend.src %>/css/*.css' - ] + options: { + livereload: '<%= connect.options.livereload %>' + }, + files: [ + '<%= accountant.frontend.src %>/{,*/}*.html', + '<%= accountant.frontend.src %>/js/*.js', + '<%= accountant.frontend.src %>/css/*.css' + ] }, requirements: { files: ['requirements.txt'], - tasks: ['shell:pip_install'] + tasks: ['shell:pipInstall'] } };