Make WordPress Core

Ticket #41057: 41057-grunt.diff

File 41057-grunt.diff, 1.2 KB (added by netweb, 7 years ago)
  • Gruntfile.js

     
    470470                                args: ['--verbose', '-c', 'phpunit.xml.dist', '--group', 'restapi-jsclient']
    471471                        }
    472472                },
     473                phpcs: {
     474                        core: {
     475                                cmd: 'phpcs',
     476                                args: ['--standard=phpcs.xml.dist', '--report-summary', '--report-source']
     477                        }
     478                },
     479                phpcbf: {
     480                        core: {
     481                                cmd: 'phpcbf',
     482                                args: ['--standard=phpcs.xml.dist', '--report-summary', '--report-source']
     483                        }
     484                },
    473485                uglify: {
    474486                        options: {
    475487                                ASCIIOnly: true,
     
    950962                }, this.async());
    951963        });
    952964
     965        grunt.registerMultiTask('phpcs', 'Runs PHPCS using phpcs.xml.dist.', function() {
     966                grunt.util.spawn({
     967                        cmd: this.data.cmd,
     968                        args: this.data.args,
     969                        opts: {stdio: 'inherit'}
     970                }, this.async());
     971        });
     972
     973        grunt.registerMultiTask('phpcbf', 'Runs PHPCBF using phpcs.xml.dist.', function() {
     974                grunt.util.spawn({
     975                        cmd: this.data.cmd,
     976                        args: this.data.args,
     977                        opts: {stdio: 'inherit'}
     978                }, this.async());
     979        });
     980
    953981        grunt.registerTask('qunit:compiled', 'Runs QUnit tests on compiled as well as uncompiled scripts.',
    954982                ['build', 'copy:qunit', 'qunit']);
    955983