Skip to content

Commit 6a46b90

Browse files
Build: Add phpstan task and include it in precommit:php
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 4513d92 commit 6a46b90

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Gruntfile.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,6 +1560,7 @@ module.exports = function(grunt) {
15601560
] );
15611561

15621562
grunt.registerTask( 'precommit:php', [
1563+
'phpstan',
15631564
'phpunit'
15641565
] );
15651566

@@ -2001,6 +2002,18 @@ module.exports = function(grunt) {
20012002

20022003
grunt.registerTask( 'test', 'Runs all QUnit and PHPUnit tasks.', ['qunit:compiled', 'phpunit'] );
20032004

2005+
grunt.registerTask( 'phpstan', 'Runs PHPStan on the entire codebase.', function() {
2006+
var done = this.async();
2007+
2008+
grunt.util.spawn( {
2009+
cmd: 'composer',
2010+
args: [ 'phpstan' ],
2011+
opts: { stdio: 'inherit' }
2012+
}, function( error ) {
2013+
done( ! error );
2014+
} );
2015+
} );
2016+
20042017
grunt.registerTask( 'format:php', 'Runs the code formatter on changed files.', function() {
20052018
var done = this.async();
20062019
var flags = this.flags;

0 commit comments

Comments
 (0)