<commit_before>var gulp = require('gulp');
postcss = require('gulp-postcss');
sourcemaps = require('gulp-sourcemaps');
atImport = require('postcss-import');
selector = require('postcss-custom-selectors')
customProperties = require("postcss-custom-properties")
nested = require('postcss-nested');
reporter = require('postcss-reporter');
newer = require('gulp-newer');
nano = require('gulp-cssnano');
notify = require('gulp-notify');
browserSync = require('browser-sync');
rename = require('gulp-rename');


gulp.task("browserSync", function() {
  browserSync({
    server: {
      baseDir: "./"
    }
  })
});

/* Notificando errores de CSS */
function errorAlertPost(error) {
  notify.onError({
    title: "Gulp postCSS",
    subtitle: "Algo esta mal en tu CSS!",
    sound: "Basso"
  })(error);
  console.log(error.toString());
  this.emit("end");
};

/* ==========================================================================
   Lanzando postCSS
   ========================================================================== */

/*
 * El orden de los plugins debe ser respetado.
 *
 * Antes de que nuestro CSS empiece a ser transformado por los diferentes
 * plugins vamos a 'lintear' nuestro CSS para seguir un orden y concierto.
 *
 *
 */

 gulp.task('css', function() {
   var processors = [
     atImport,
     reporter({
       clearMessages: true
     }),
     nested,
     customProperties,
     selector
   ];
   return gulp.src('./src/css/styles.css')

   .pipe(sourcemaps.init())
     .pipe(postcss(processors))
     .on("error", errorAlertPost)
     .pipe(sourcemaps.write('./', {
       sourceRoot: '/src'
     }))
     .pipe(rename('astral.css'))
     .pipe(gulp.dest('./css'))
     .pipe(notify({
       message: 'postCSS complete'
     }));
 });

/* Lanzando CSSnano para comprimir CSS */
gulp.task('minify', function() {
  return gulp.src('./css/styles.css')
    .pipe(nano())
    .pipe(rename('astral.min.css'))
    .pipe(gulp.dest('./css'))
    .pipe(notify({
      message: 'CSSnano task complete'
    }));
});

/* Tarea por defecto para compilar CSS y comprimir imagenes */
gulp.task('default', ["browserSync"], function() {
  gulp.watch('./src/css/**', ['css']);
  gulp.watch(["./*.html", "css/*.css"]).on("change", browserSync.reload);
});

/* Tarea final para comprimir CSS y JavaScript */
gulp.task('build', ['minify']);<commit_msg>corrigiendo un error a la hora de minificar astral<commit_after>var gulp = require('gulp');
postcss = require('gulp-postcss');
sourcemaps = require('gulp-sourcemaps');
atImport = require('postcss-import');
selector = require('postcss-custom-selectors')
customProperties = require("postcss-custom-properties")
nested = require('postcss-nested');
reporter = require('postcss-reporter');
newer = require('gulp-newer');
nano = require('gulp-cssnano');
notify = require('gulp-notify');
browserSync = require('browser-sync');
rename = require('gulp-rename');


gulp.task("browserSync", function() {
  browserSync({
    server: {
      baseDir: "./"
    }
  })
});

/* Notificando errores de CSS */
function errorAlertPost(error) {
  notify.onError({
    title: "Gulp postCSS",
    subtitle: "Algo esta mal en tu CSS!",
    sound: "Basso"
  })(error);
  console.log(error.toString());
  this.emit("end");
};

/* ==========================================================================
   Lanzando postCSS
   ========================================================================== */

/*
 * El orden de los plugins debe ser respetado.
 *
 * Antes de que nuestro CSS empiece a ser transformado por los diferentes
 * plugins vamos a 'lintear' nuestro CSS para seguir un orden y concierto.
 *
 *
 */

 gulp.task('css', function() {
   var processors = [
     atImport,
     reporter({
       clearMessages: true
     }),
     nested,
     customProperties,
     selector
   ];
   return gulp.src('./src/css/styles.css')

   .pipe(sourcemaps.init())
     .pipe(postcss(processors))
     .on("error", errorAlertPost)
     .pipe(sourcemaps.write('./', {
       sourceRoot: '/src'
     }))
     .pipe(rename('astral.css'))
     .pipe(gulp.dest('./css'))
     .pipe(notify({
       message: 'postCSS complete'
     }));
 });

/* Lanzando CSSnano para comprimir CSS */
gulp.task('minify', function() {
  return gulp.src('./css/astral.css')
    .pipe(nano())
    .pipe(rename('astral.min.css'))
    .pipe(gulp.dest('./css'))
    .pipe(notify({
      message: 'CSSnano task complete'
    }));
});

/* Tarea por defecto para compilar CSS y comprimir imagenes */
gulp.task('default', ["browserSync"], function() {
  gulp.watch('./src/css/**', ['css']);
  gulp.watch(["./*.html", "css/*.css"]).on("change", browserSync.reload);
});

/* Tarea final para comprimir CSS y JavaScript */
gulp.task('build', ['minify']);
{'fraction_non_alphanumeric': 0.23418120664284212, 'fraction_numerical': 0.0, 'mean_word_length': 3.7437686939182453, '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': '703333', 'n_tokens_mistral': 1514, 'n_tokens_neox': 1499, 'n_words': 321}