Skip to content

Commit

Permalink
Get phpcs task from devpackages 2.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ronilaukkarinen committed Apr 11, 2022
1 parent 454404a commit fb48c8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions gulp/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ module.exports = {
]
},
phpcs: {
src: [themeDir + '**/*.php', '!' + themeDir + 'node_modules/**/*'],
opts: {
bin: '/usr/local/bin/phpcs',
standard: themeDir + 'phpcs.xml',
Expand Down
5 changes: 3 additions & 2 deletions gulp/tasks/phpcs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ const phpcsplugin = require('gulp-phpcs');
const config = require('../config.js');

// Task
function phpcs() {
return src(config.php.watch)
function phpcs(cb) {
return src(config.phpcs.src)

// Validate files using PHP Code Sniffer
.pipe(phpcsplugin(config.phpcs.opts))

// Log all problems that was found
.pipe(phpcsplugin.reporter('log'));
cb();
}

exports.phpcs = phpcs;

0 comments on commit fb48c8f

Please sign in to comment.