From 62620a3fdbe99c6ef847529d5ceffb95decf7875 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=CC=88rn=20Zaefferer?= Date: Wed, 18 Mar 2015 13:25:51 +0100 Subject: [PATCH] Build: Update grunt-jscs to latest, use exceptions to improve coverage Closes gh-1506 --- Gruntfile.js | 32 ++++++++++++++++++++++++++------ package.json | 2 +- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index d91dedb9b..62b283960 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -76,7 +76,9 @@ var "dist/jquery-ui.min.js" ] }, - component = grunt.option( "component" ) || "**"; + component = grunt.option( "component" ) || "**", + + jscsBad = [ "ui/tabs.js", "ui/slider.js", "ui/selectable.js", "ui/resizable.js", "ui/mouse.js", "ui/menu.js", "ui/effect*.js", "ui/droppable.js", "ui/draggable.js", "ui/button.js", "ui/datepicker.js", "ui/sortable.js" ]; function mapMinFile( file ) { return "dist/" + file.replace( /ui\//, "minified/" ); @@ -158,12 +160,30 @@ grunt.initConfig({ dest: "dist/jquery-ui.css" } }, + + // Remove the requireSpacesInsideParentheses override once everything is fixed jscs: { - // datepicker and sortable are getting rewritten, ignore until that's done - ui: [ "ui/*.js", "!ui/datepicker.js", "!ui/sortable.js" ], - // TODO enable this once we have a tool that can auto format files - // tests: "tests/unit/**/*.js", - grunt: [ "Gruntfile.js", "build/tasks/*.js" ] + "ui-good": [ "ui/*.js" ].concat( jscsBad.map( function( file ) { + return "!" + file; + } ) ), + "ui-bad": { + options: { + requireSpacesInsideParentheses: null + }, + src: jscsBad + }, + tests: { + options: { + requireSpacesInsideParentheses: null + }, + src: "tests/unit/**/*.js" + }, + grunt: { + options: { + requireSpacesInsideParentheses: null + }, + src: [ "Gruntfile.js", "build/tasks/*.js" ] + } }, uglify: minify, htmllint: { diff --git a/package.json b/package.json index b7ab3780d..3058cb833 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "grunt-esformatter": "0.2.0", "grunt-git-authors": "2.0.0", "grunt-html": "1.0.0", - "grunt-jscs": "0.6.2", + "grunt-jscs": "1.5.0", "load-grunt-tasks": "0.3.0", "rimraf": "2.1.4", "testswarm": "1.1.0" -- 2.39.5