Skip to:
Content

BuddyPress.org

Changeset 9697


Ignore:
Timestamp:
04/05/2015 02:21:26 PM (10 years ago)
Author:
djpaul
Message:

Build: add SCSS linter (grunt-scss-lint) to Grunt build process.

As part of the companion stylesheet changes for BP 2.3 (#6291 #6338), we'll be adding SCSS files to src/bp-templates/bp-legacy/css/ to help modernise our CSS workflow. This change adds a SCSS linter to help us maintain our code quality.

An empty src/bp-templates/bp-legacy/css/twentyfifteen.scss file has been added because the linter hangs if you tell it to run in a folder that does not contain any SCSS files. This will be replaced shortly with the real companion stylesheet for twentyfifteen (#6291).

As grunt-scss-lint relies on a ruby gem, the Travis-CI config has been modified to install it before running tests.

Fixes #6351, props netweb.

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/.travis.yml

    r9560 r9697  
    5656    - cd $plugin_dir
    5757    - npm install -g grunt-cli
     58    - gem install scss-lint
    5859
    5960# before_script: Failures in this section will result in build status 'errored'
  • trunk/Gruntfile.js

    r9665 r9697  
    164164            }
    165165        },
     166        scsslint: {
     167            options: {
     168                bundleExec: false,
     169                colorizeOutput: true,
     170                config: '.scss-lint.yml'
     171            },
     172            core: [ SOURCE_DIR + 'bp-templates/bp-legacy/css/*.scss' ]
     173        },
    166174        cssmin: {
    167175            minify: {
     
    229237     * Register tasks.
    230238     */
    231     grunt.registerTask( 'src',     ['jsvalidate:src', 'jshint', 'cssjanus'] );
     239    grunt.registerTask( 'src',     ['jsvalidate:src', 'jshint', 'scsslint', 'cssjanus'] );
    232240    grunt.registerTask( 'commit',  ['src', 'checktextdomain', 'imagemin'] );
    233241    grunt.registerTask( 'build',   ['commit', 'clean:all', 'copy:files', 'uglify', 'jsvalidate:build', 'cssmin', 'makepot', 'exec:bpdefault'] );
  • trunk/package.json

    r9584 r9697  
    2121    "grunt-patch-wordpress": "~0.3.0",
    2222    "grunt-sass": "~0.18.0",
     23    "grunt-scss-lint": "~0.3.6",
    2324    "grunt-wp-i18n": "~0.5.0",
    2425    "matchdep": "~0.3.0"
Note: See TracChangeset for help on using the changeset viewer.