<commit_before>'use strict';
/**
 * Task runner for unit tests
 *
 * How To:
 *
 * Using Gulp.js to check your code quality
 * https://marcofranssen.nl/using-gulp-js-to-check-your-code-quality/
 */

var gulp = require('gulp');
var phpunit = require('gulp-phpunit');
var notify  = require('gulp-notify');


gulp.task('phpunit', function () {
    var options = {debug: false, notify: true};
    gulp.src('phpunit.xml')
      .pipe(phpunit('vendor/bin/phpunit --verbose tests', options))
      .on('error', notify.onError({
        title: "Failed Tests!",
        message: "Error(s) occurred during testing..."
      }));
});

gulp.task('watch', function () {
  gulp.watch(['composer.json', 'phpunit.xml', './**/*.php', './**/*.inc', '!vendor/**/*', '!node_modules/**/*'],
    function (event) {
        console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
    });
  gulp.watch('composer.json', ['dump-autoload']);
  gulp.watch(['phpunit.xml', './**/*.php', './**/*.inc', '!vendor/**/*', '!node_modules/**/*'], ['phpunit']);
});

gulp.task('default', ['phpunit', 'watch']);<commit_msg>Add phplint into gulp pipline<commit_after>'use strict';
/**
 * Task runner for unit tests
 *
 * How To:
 *
 * Using Gulp.js to check your code quality
 * https://marcofranssen.nl/using-gulp-js-to-check-your-code-quality/
 */

var gulp = require('gulp');
var phplint = require('phplint').lint;
var phpunit = require('gulp-phpunit');
var notify  = require('gulp-notify');

gulp.task('phplint', function (cb) {
    phplint(['./src/*.php', '!node_modules/**/*', '!vendor/**/*'],  { limit: 10 }, function (err, stdout, stderr) {
      if (err) {
        cb(err);
        process.exit(1);
      }
      cb();
    });
});

gulp.task('phpunit', function () {
    var options = {debug: false, notify: true};
    gulp.src('phpunit.xml')
      .pipe(phpunit('vendor/bin/phpunit --verbose tests', options))
      .on('error', notify.onError({
        title: "Failed Tests!",
        message: "Error(s) occurred during testing..."
      }));
});

gulp.task('watch', function () {
  gulp.watch(['composer.json', 'phpunit.xml', './**/*.php', './**/*.inc', '!vendor/**/*', '!node_modules/**/*'],
    function (event) {
        console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
    });
  gulp.watch('composer.json', ['dump-autoload']);
  gulp.watch(['phpunit.xml', './**/*.php', './**/*.inc', '!vendor/**/*', '!node_modules/**/*'], ['phplint', 'phpunit']);
});

gulp.task('default', ['phplint', 'phpunit', 'watch']);
gulp.task('test', ['phplint', 'phpunit']);
{'fraction_non_alphanumeric': 0.25193498452012386, 'fraction_numerical': 0.0011609907120743034, 'mean_word_length': 3.337248322147651, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5845983', 'n_tokens_mistral': 902, 'n_tokens_neox': 897, 'n_words': 180}