<commit_before>'use strict';

// This gulpfile makes use of new JavaScript features.
// Babel handles this without us having to do anything. It just works.
// You can read more about the new JavaScript features here:
// https://babeljs.io/docs/learn-es2015/

import gulp from 'gulp';
import gutil from 'gulp-util';
import del from 'del';
import runSequence from 'run-sequence';
import autoprefixer from 'autoprefixer';
import mqpacker from 'css-mqpacker';
import cssnano from 'cssnano';
import postcssImport from 'postcss-import';
import postcssEach from 'postcss-each';
import postcssApply from 'postcss-apply';
import postcssSimpleVars from 'postcss-simple-vars';
import postcssCustomMedia from 'postcss-custom-media';
import postcssCustomSelectors from 'postcss-custom-selectors';
import postcssNested from 'postcss-Nested';
import postcssCssVariables from 'postcss-css-variables';
import postcssSelectorNot from 'postcss-selector-not';
import postcssCalc from 'postcss-calc';
import postcssLogicalProps from 'postcss-logical-props';
import postcssFlexbugsFixes from 'postcss-flexbugs-fixes';
import postcssReporter from 'postcss-reporter';
import postcssColor from 'postcss-color-function';
import gulpLoadPlugins from 'gulp-load-plugins';

const $ = gulpLoadPlugins();
const AUTOPREFIXER_BROWSERS = ['last 2 versions'];

gulp.task('lint-css', function lintCSS() {
  const gulpStylelint = require('gulp-stylelint');
  return gulp
    .src('src/css/**/*.css')
    .pipe(gulpStylelint({
      reporters: [
        {formatter: 'string', console: true}
      ]
    }));
});


// Compile everything and test
gulp.task('styles', () => {
  const PROCESSORS = [
    postcssImport({ glob: true }),
    postcssEach,
    postcssApply,
    postcssSimpleVars,
    postcssCustomMedia,
    postcssCustomSelectors,
    postcssNested,
    postcssCssVariables,
    postcssSelectorNot,
    postcssCalc,
    postcssColor,
    postcssLogicalProps,
    postcssFlexbugsFixes,
    autoprefixer({browsers: AUTOPREFIXER_BROWSERS}),
    mqpacker,
    cssnano,
    postcssReporter({clearMessages: true})
  ];
// For best performance, don't add Sass partials to `gulp.src`
return gulp.src(['src/css/*.css'])
  .pipe($.sourcemaps.init())
  .pipe($.postcss(PROCESSORS)).on('error', gutil.log)
  .pipe($.sourcemaps.write('./'))
  .pipe(gulp.dest('resources/public/css'));
});

// Compile CSS
gulp.task('dist', () => {
  const PROCESSORS = [
    postcssImport({ glob: true }),
    postcssEach,
    postcssApply,
    postcssSimpleVars,
    postcssCustomMedia,
    postcssCustomSelectors,
    postcssNested,
    postcssCssVariables,
    postcssSelectorNot,
    postcssCalc,
    postcssColor,
    postcssLogicalProps,
    postcssFlexbugsFixes,
    autoprefixer({browsers: AUTOPREFIXER_BROWSERS}),
    mqpacker,
    cssnano,
    postcssReporter({clearMessages: true})
  ];
return gulp.src(['src/css/*.css'])
  .pipe($.postcss(PROCESSORS)).on('error', gutil.log)
  .pipe(gulp.dest('dist'));
})


// Clean output directory
gulp.task('clean', () => del(['.tmp', 'resources/public/*', '!resources/public/.git', '!resources/public/js'], {dot: true}));


// Watch files for changes & recompile
gulp.task('watch', ['styles'], () => {
  gulp.watch(['src/css/**/*.css'], ['styles']);
});


// Build production files, the default task
gulp.task('default', cb =>
runSequence(
  'lint-css',
  'styles',
  cb
)
);


// Load custom tasks from the `tasks` directory
// Run: `npm install --save-dev require-dir` from the command-line
// try { require('require-dir')('tasks'); } catch (err) { console.error(err); }<commit_msg>Updated gulp default<commit_after>'use strict';

// This gulpfile makes use of new JavaScript features.
// Babel handles this without us having to do anything. It just works.
// You can read more about the new JavaScript features here:
// https://babeljs.io/docs/learn-es2015/

import gulp from 'gulp';
import gutil from 'gulp-util';
import del from 'del';
import runSequence from 'run-sequence';
import autoprefixer from 'autoprefixer';
import mqpacker from 'css-mqpacker';
import cssnano from 'cssnano';
import postcssImport from 'postcss-import';
import postcssEach from 'postcss-each';
import postcssApply from 'postcss-apply';
import postcssSimpleVars from 'postcss-simple-vars';
import postcssCustomMedia from 'postcss-custom-media';
import postcssCustomSelectors from 'postcss-custom-selectors';
import postcssNested from 'postcss-Nested';
import postcssCssVariables from 'postcss-css-variables';
import postcssSelectorNot from 'postcss-selector-not';
import postcssCalc from 'postcss-calc';
import postcssLogicalProps from 'postcss-logical-props';
import postcssFlexbugsFixes from 'postcss-flexbugs-fixes';
import postcssReporter from 'postcss-reporter';
import postcssColor from 'postcss-color-function';
import gulpLoadPlugins from 'gulp-load-plugins';

const $ = gulpLoadPlugins();
const AUTOPREFIXER_BROWSERS = ['last 2 versions'];

gulp.task('lint-css', function lintCSS() {
  const gulpStylelint = require('gulp-stylelint');
  return gulp
    .src('src/css/**/*.css')
    .pipe(gulpStylelint({
      reporters: [
        {formatter: 'string', console: true}
      ]
    }));
});


// Compile everything and test
gulp.task('styles', () => {
  const PROCESSORS = [
    postcssImport({ glob: true }),
    postcssEach,
    postcssApply,
    postcssSimpleVars,
    postcssCustomMedia,
    postcssCustomSelectors,
    postcssNested,
    postcssCssVariables,
    postcssSelectorNot,
    postcssCalc,
    postcssColor,
    postcssLogicalProps,
    postcssFlexbugsFixes,
    autoprefixer({browsers: AUTOPREFIXER_BROWSERS}),
    mqpacker,
    cssnano,
    postcssReporter({clearMessages: true})
  ];
// For best performance, don't add Sass partials to `gulp.src`
return gulp.src(['src/css/*.css'])
  .pipe($.sourcemaps.init())
  .pipe($.postcss(PROCESSORS)).on('error', gutil.log)
  .pipe($.sourcemaps.write('./'))
  .pipe(gulp.dest('resources/public/css'));
});

// Compile CSS
gulp.task('dist', () => {
  const PROCESSORS = [
    postcssImport({ glob: true }),
    postcssEach,
    postcssApply,
    postcssSimpleVars,
    postcssCustomMedia,
    postcssCustomSelectors,
    postcssNested,
    postcssCssVariables,
    postcssSelectorNot,
    postcssCalc,
    postcssColor,
    postcssLogicalProps,
    postcssFlexbugsFixes,
    autoprefixer({browsers: AUTOPREFIXER_BROWSERS}),
    mqpacker,
    cssnano,
    postcssReporter({clearMessages: true})
  ];
return gulp.src(['src/css/*.css'])
  .pipe($.postcss(PROCESSORS)).on('error', gutil.log)
  .pipe(gulp.dest('dist'));
})


// Clean output directory
gulp.task('clean', () => del(['.tmp', 'resources/public/*', '!resources/public/.git', '!resources/public/js'], {dot: true}));


// Watch files for changes & recompile
gulp.task('watch', ['styles'], () => {
  gulp.watch(['src/css/**/*.css'], ['styles']);
});


// Build production files, the default task
gulp.task('default', cb =>
runSequence(
  'styles',
  cb
)
);


// Load custom tasks from the `tasks` directory
// Run: `npm install --save-dev require-dir` from the command-line
// try { require('require-dir')('tasks'); } catch (err) { console.error(err); }
{'fraction_non_alphanumeric': 0.14387683694891532, 'fraction_numerical': 0.0013995801259622112, 'mean_word_length': 4.385079125847777, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '4287123', 'n_tokens_mistral': 2373, 'n_tokens_neox': 2346, 'n_words': 539}