[wp-trac] [WordPress Trac] #29792: Grunt: Add a precommit task to check for CSS syntax errors

WordPress Trac noreply at wordpress.org
Sun Oct 12 00:36:28 UTC 2014


#29792: Grunt: Add a precommit task to check for CSS syntax errors
------------------------------+------------------
 Reporter:  helen             |       Owner:
     Type:  enhancement       |      Status:  new
 Priority:  normal            |   Milestone:  4.1
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  has-patch         |     Focuses:
------------------------------+------------------

Comment (by netweb):

 In [https://core.trac.wordpress.org/attachment/ticket/29792/29792.patch
 29792.patch]:

 * Adds `.csslintrc` file with the rules per Nacin's suggested settings in
 [comment:11 comment 11], also explicitly declares the other available
 [https://github.com/CSSLint/csslint/wiki/Rules rules] as `true` for
 completeness/verbosity

 * Adds `grunt-contrib-csslint` to `package.json`
 https://github.com/gruntjs/grunt-contrib-csslint

 * New Grunt task `grunt csslint`

 * Grunt sub tasks `grunt csslint:core` and `grunt csslint:build` to lint
 CSS files in respective `/src` and `/build` folders
  * `wp-admin/css/*.css`
  * `wp-
 content/themes/twenty{ten,eleven,twelve,thirteen,fourteen,fifteen}/**/*.css`
  * `wp-includes/css/*.css`

 * Adds `grunt csslint:core` to precommit task `grunt precommit`

 * Adds `grunt csslint:build` to both `grunt rtl` and `grunt colors` tasks
 as a psuedo CSS validator after CSSJanus, SASS, and AutoPrefixer compilers
 have parsed existing CSS/SASS files.

 * Adds `grunt csslint:core` to Grunt build task `grunt`/`grunt build`
 before other CSS tasks are run

 * Adds `grunt csslint:build` to Grunt build task `grunt`/`grunt build`
 after other CSS tasks have ran


 ----

 Notes:

 * If testing this patch in your workflow you may need to add `--force` to
 the task `grunt precommit` to get past any current errors until Core
 patches existing CSS issues per the CSS Lint rules here

 * A few tweaks are needed to existing Grunt watch tasks to include support
 for this, including it in this `29792.patch` kind of made things rather
 funky as most of the existing CSS tasks need updating also to accommodate
 this.

 * Included in the patch are all WordPress Core themes, Twenty Ten, Eleven,
 Twelve, Thirteen, Fourteen, and Fifteen

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29792#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list