<commit_before>'use strict';
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var rimraf = require('rimraf');
var browserSync = require('browser-sync');
var pagespeed = require('psi');
var reload = browserSync.reload;

// public URL for your website
var PUBLIC_URL = 'https://example.com';

// enable use of relative paths even though gulp is run in sub-directories
process.chdir(__dirname);

gulp.task('styles', function () {
    return gulp.src('app/styles/sass/styles.scss')
        .pipe($.rubySass({style: 'expanded', precision: 10}))
        .pipe($.autoprefixer('last 1 version'))
        .pipe(gulp.dest('dist/styles'))
        .pipe(reload({stream: true}))
        .pipe($.size({title: 'styles'}));
});

gulp.task('jshint', function () {
    return gulp.src('app/scripts/**/*.js')
        .pipe($.jshint())
        .pipe($.jshint.reporter('jshint-stylish'))
        .pipe($.jshint.reporter('fail'))
        .pipe(reload({stream: true, once: true}))
        .pipe($.size({title: 'jshint'}));
});

gulp.task('html', ['styles'], function () {
    return gulp.src('app/**/*.html')
        .pipe($.useref.assets())
        .pipe($.if('*.js', $.uglify()))
        .pipe($.if('*.css', $.csso()))
        .pipe($.useref.restore())
        .pipe($.useref())
        .pipe(gulp.dest('dist'))
        .pipe($.size({title: 'html'}));
});

gulp.task('images', function () {
    return gulp.src('app/images/**/*')
        .pipe($.cache($.imagemin({
            progressive: true,
            interlaced: true
        })))
        .pipe(gulp.dest('dist/images'))
        .pipe(reload({stream: true, once: true}))
        .pipe($.size({title: 'images'}));
});

gulp.task('pagespeed', function (cb) {
    pagespeed({
        // key: A developer API key if you have one
        // See http://goo.gl/RkN0vE for more details
        nokey: 'true',
        url: PUBLIC_URL,
        strategy: 'mobile',
    }, cb);
});

gulp.task('clean', rimraf.bind(null, 'dist'));

gulp.task('serve', ['styles'], function () {
    browserSync.init(null, {
        server: {
            baseDir: ['app']
        }
    });
});

gulp.task('watch', ['serve'], function () {
    gulp.watch(['app/*.html'], reload);
    gulp.watch(['app/styles/**/*.{css,scss}'], ['styles']);
    gulp.watch(['app/scripts/**/*.js'], ['jshint']);
    gulp.watch(['app/images/**/*'], ['images']);
});

gulp.task('build', ['jshint', 'html', 'images']);

gulp.task('default', ['clean'], function (cb) {
    gulp.start('build', cb);
});
<commit_msg>gulpfile - tweak pageres task<commit_after>'use strict';
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var rimraf = require('rimraf');
var browserSync = require('browser-sync');
var pagespeed = require('psi');
var reload = browserSync.reload;

// public URL for your website
var PUBLIC_URL = 'https://example.com';

// enable use of relative paths even though gulp is run in sub-directories
process.chdir(__dirname);

gulp.task('styles', function () {
    return gulp.src('app/styles/sass/styles.scss')
        .pipe($.rubySass({style: 'expanded', precision: 10}))
        .pipe($.autoprefixer('last 1 version'))
        .pipe(gulp.dest('dist/styles'))
        .pipe(reload({stream: true}))
        .pipe($.size({title: 'styles'}));
});

gulp.task('jshint', function () {
    return gulp.src('app/scripts/**/*.js')
        .pipe($.jshint())
        .pipe($.jshint.reporter('jshint-stylish'))
        .pipe($.jshint.reporter('fail'))
        .pipe(reload({stream: true, once: true}))
        .pipe($.size({title: 'jshint'}));
});

gulp.task('html', ['styles'], function () {
    return gulp.src('app/**/*.html')
        .pipe($.useref.assets())
        .pipe($.if('*.js', $.uglify()))
        .pipe($.if('*.css', $.csso()))
        .pipe($.useref.restore())
        .pipe($.useref())
        .pipe(gulp.dest('dist'))
        .pipe($.size({title: 'html'}));
});

gulp.task('images', function () {
    return gulp.src('app/images/**/*')
        .pipe($.cache($.imagemin({
            progressive: true,
            interlaced: true
        })))
        .pipe(gulp.dest('dist/images'))
        .pipe(reload({stream: true, once: true}))
        .pipe($.size({title: 'images'}));
});

gulp.task('pagespeed', pagespeed.bind(null, {
    // a developer API key if you have one
    // key: '',
    nokey: 'true', // see http://goo.gl/RkN0vE for more details
    url: PUBLIC_URL,
    strategy: 'mobile'
}));

gulp.task('clean', rimraf.bind(null, 'dist'));

gulp.task('serve', ['styles'], function () {
    browserSync.init(null, {
        server: {
            baseDir: ['app']
        }
    });
});

gulp.task('watch', ['serve'], function () {
    gulp.watch(['app/*.html'], reload);
    gulp.watch(['app/styles/**/*.{css,scss}'], ['styles']);
    gulp.watch(['app/scripts/**/*.js'], ['jshint']);
    gulp.watch(['app/images/**/*'], ['images']);
});

gulp.task('build', ['jshint', 'html', 'images']);

gulp.task('default', ['clean'], function (cb) {
    gulp.start('build', cb);
});

{'fraction_non_alphanumeric': 0.23702076677316294, 'fraction_numerical': 0.001597444089456869, 'mean_word_length': 2.9286274509803922, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '7074611', 'n_tokens_mistral': 1726, 'n_tokens_neox': 1717, 'n_words': 312}