Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1724,6 +1724,7 @@ module.exports = function(grunt) {

grunt.registerTask( 'precommit:php', [
'phpstan',
'compat:php',
'phpunit'
] );

Expand Down Expand Up @@ -2260,7 +2261,7 @@ module.exports = function(grunt) {
grunt.registerTask( 'format:php', 'Runs the code formatter on changed files.', function() {
var done = this.async();
var flags = this.flags;
var args = changedFiles.php;
var args = changedFiles.php.slice();

args.unshift( 'format' );

Expand All @@ -2280,7 +2281,7 @@ module.exports = function(grunt) {
grunt.registerTask( 'lint:php', 'Runs the code linter on changed files.', function() {
var done = this.async();
var flags = this.flags;
var args = changedFiles.php;
var args = changedFiles.php.slice();

args.unshift( 'lint' );

Expand All @@ -2297,6 +2298,21 @@ module.exports = function(grunt) {
} );
} );

grunt.registerTask( 'compat:php', 'Runs the PHPCompatibility ruleset on changed files.', function() {
var done = this.async();
var args = changedFiles.php.slice();

args.unshift( 'compat' );

grunt.util.spawn( {
cmd: 'composer',
args: args,
opts: { stdio: 'inherit' }
}, function( error ) {
done( ! error );
} );
} );

grunt.registerTask( 'wp-packages:update', 'Update WordPress packages', function() {
const distTag = grunt.option('dist-tag') || 'latest';
grunt.log.writeln( `Updating WordPress packages (--dist-tag=${distTag})` );
Expand Down
Loading