<commit_before>import browserSync from 'browser-sync';
import del from 'del';

import fs from 'fs';

import gulp from 'gulp';
import gulpLoadPlugins from 'gulp-load-plugins';

import sassdoc from 'sassdoc';

import runSequence from 'run-sequence';

// postCss plugins
import autoprefixer from 'autoprefixer';
import mdcss from 'mdcss';
import reporter from 'postcss-reporter';
import scssSyntax from 'postcss-scss';
import stylelint from 'stylelint';

import jigsassMdcss from 'mdcss-theme-jigsass';

const $ = gulpLoadPlugins();
const reload = browserSync.reload;

gulp.task('sass:lint', () =>
  gulp.src('scss/**/*.scss')
    .pipe($.plumber())
    .pipe($.postcss([
      stylelint(),
      reporter({
        clearMessages: true,
        throwError: true,
      }),
    ],
    { syntax: scssSyntax }))
);

gulp.task('sass:test', () =>
  gulp.src('test/*.js')
    .pipe($.mocha({ reporter: 'spec' }))
);

gulp.task('sass:doc', () => {
  if (genDocs()) {
    runSequence(
      ['sass:lint', 'sass:test'],
      runSassDoc);
  }

  function runSassDoc() {
    return gulp.src('scss/**/*.scss')
      .pipe($.plumber())
      .pipe(sassdoc());
  }

  function genDocs() {
    try {
      fs.accessSync('noSassDocs', fs.F_OK); return false;
    }
    catch (e) { return true; }
  }
});

gulp.task('sass:sg', ['sass:lint', 'sass:test', 'clean'], () => {
  if (genDocs()) {
    runSequence(
      ['sass:lint', 'sass:test', 'clean'],
      generateSg);
  }

  function generateSg() {
    return gulp.src('sgSrc/sg.scss')
      .pipe($.plumber())
      .pipe($.sass.sync({
        outputStyle: 'expanded',
        precision: 10,
        includePaths: ['scss'],
      }).on('error', $.sass.logError))
      .pipe($.postcss([
        autoprefixer({ browsers: ['> 1%', 'last two versions', 'ie > 7'] }),
        mdcss({
          theme: jigsassMdcss({ title: '<%= moduleName %>' }),
          assets: ['scSrc/assets'],
        }),
      ]));
  }

  function genDocs() {
    try {
      fs.accessSync('noSstyleguide', fs.F_OK); return false;
    }
    catch (e) { return true; }
  }
});

gulp.task('serve:sassdoc', ['sass:doc'], () => {
  browserSync({
    notify: true,
    port: 9000,
    reloadDelay: 4000,
    server: {
      baseDir: 'sassdoc',
    },
  });

  gulp.watch(['sassdoc/**/*']).on('change', reload);

  gulp.watch('scss/**/*.scss', ['sass:doc']);
});
<commit_msg>Fix typos in postCss options<commit_after>import browserSync from 'browser-sync';
import del from 'del';

import fs from 'fs';

import gulp from 'gulp';
import gulpLoadPlugins from 'gulp-load-plugins';

import sassdoc from 'sassdoc';

import runSequence from 'run-sequence';

// postCss plugins
import autoprefixer from 'autoprefixer';
import mdcss from 'mdcss';
import reporter from 'postcss-reporter';
import scssSyntax from 'postcss-scss';
import stylelint from 'stylelint';

import jigsassMdcss from 'mdcss-theme-jigsass';

const $ = gulpLoadPlugins();
const reload = browserSync.reload;

gulp.task('sass:lint', () =>
  gulp.src('scss/**/*.scss')
    .pipe($.plumber())
    .pipe($.postcss([
      stylelint(),
      reporter({
        clearMessages: true,
        throwError: true,
      }),
    ],
    { syntax: scssSyntax }))
);

gulp.task('sass:test', () =>
  gulp.src('test/*.js')
    .pipe($.mocha({ reporter: 'spec' }))
);

gulp.task('sass:doc', () => {
  if (genDocs()) {
    runSequence(
      ['sass:lint', 'sass:test'],
      runSassDoc);
  }

  function runSassDoc() {
    return gulp.src('scss/**/*.scss')
      .pipe($.plumber())
      .pipe(sassdoc());
  }

  function genDocs() {
    try {
      fs.accessSync('noSassDocs', fs.F_OK); return false;
    }
    catch (e) { return true; }
  }
});

gulp.task('sass:sg', ['sass:lint', 'sass:test', 'clean'], () => {
  if (genDocs()) {
    runSequence(
      ['sass:lint', 'sass:test', 'clean'],
      generateSg);
  }

  function generateSg() {
    return gulp.src('sgSrc/sg.scss')
      .pipe($.plumber())
      .pipe($.sass.sync({
        outputStyle: 'expanded',
        precision: 10,
        includePaths: ['scss'],
      }).on('error', $.sass.logError))
      .pipe($.postcss([
        autoprefixer({ browsers: ['> 1%', 'last 2 versions', 'ie > 7'] }),
        mdcss({
          theme: jigsassMdcss({ title: '<%= moduleName %>' }),
          assets: ['sgSrc/assets'],
        }),
      ]));
  }

  function genDocs() {
    try {
      fs.accessSync('noSstyleguide', fs.F_OK); return false;
    }
    catch (e) { return true; }
  }
});

gulp.task('serve:sassdoc', ['sass:doc'], () => {
  browserSync({
    notify: true,
    port: 9000,
    reloadDelay: 4000,
    server: {
      baseDir: 'sassdoc',
    },
  });

  gulp.watch(['sassdoc/**/*']).on('change', reload);

  gulp.watch('scss/**/*.scss', ['sass:doc']);
});

{'fraction_non_alphanumeric': 0.20046228199201513, 'fraction_numerical': 0.0052532044547173775, 'mean_word_length': 2.8984438984438983, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '3005681', 'n_tokens_mistral': 1781, 'n_tokens_neox': 1745, 'n_words': 340}