<commit_before>var pkg = require('../../package.js'),
    gulp = require('gulp'),
    gulp_tslint = require("gulp-tslint");

gulp.task('lint:ts', function () {
    var tslint = [{
        configuration: 'tslint.json',
        formatter: 'verbose'
    }];
    if (pkg.dizmo && pkg.dizmo.build) {
        var build = pkg.dizmo.build;
        if (build.lint !== null && typeof build.lint === 'object') {
            tslint = build.lint;
        } else if (build.lint === false) {
            tslint = false;
        }
    }
    if (tslint) {
        return gulp.src([
            './src/**/*.ts', '!src/lib/**', '!build/**', '!node_modules/**'])
            .pipe(gulp_tslint.apply(this, tslint))
            .pipe(gulp_tslint.report({emitError: false}));
    }
});

gulp.task('lint', ['lint:ts']);<commit_msg>DIG-100: TypeScript linting via CLI option<commit_after>var pkg = require('../../package.js'),
    extend = require('xtend');
var gulp = require('gulp'),
    gulp_tslint = require("gulp-tslint");

gulp.task('lint:ts', function () {
    var lint = true;
    if (pkg.dizmo && pkg.dizmo.build) {
        var cfg_lint = pkg.dizmo.build.lint;
        if (cfg_lint || cfg_lint === undefined) {
            lint = extend({}, cfg_lint);
        } else {
            lint = false;
        }
    }

    var argv = require('yargs')
        .default('lint', lint).argv;
    if (typeof argv.lint === 'string') {
        argv.lint = JSON.parse(argv.lint);
    }

    var bundle = gulp.src([
        './src/**/*.ts', '!src/lib/**', '!build/**', '!node_modules/**']);
    if (argv.lint || argv.lint === undefined) {
        bundle = bundle.pipe(gulp_tslint.apply(this, [extend({
            formatter: 'stylish'
        }, argv.lint)]));
        bundle = bundle.pipe(gulp_tslint.report({
            emitError: false
        }));
    }
    return bundle;
});

gulp.task('lint', ['lint:ts']);
{'fraction_non_alphanumeric': 0.1997874601487779, 'fraction_numerical': 0.001594048884165781, 'mean_word_length': 2.186125211505922, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1462304', 'n_tokens_mistral': 649, 'n_tokens_neox': 634, 'n_words': 120}