<commit_before>/*
 * grunt-contrib-less
 * http://gruntjs.com/
 *
 * Copyright (c) 2015 <NAME>, contributors
 * Licensed under the MIT license.
 */

'use strict';

var path = require('path');
var _ = require('lodash');
var async = require('async');
var chalk = require('chalk');
var less = require('less');

module.exports = function(grunt) {
  grunt.registerMultiTask('less', 'Compile LESS files to CSS', function() {
    var done = this.async();

    var options = this.options({
      banner: ''
    });

    if (this.files.length < 1) {
      grunt.verbose.warn('Destination not written because no source files were provided.');
    }

    async.eachSeries(this.files, function(f, nextFileObj) {
      var destFile = f.dest;

      var files = f.src.filter(function(filepath) {
        // Warn on and remove invalid source files (if nonull was set).
        if (!grunt.file.exists(filepath)) {
          grunt.log.warn('Source file "' + filepath + '" not found.');
          return false;
        } else {
          return true;
        }
      });

      if (files.length === 0) {
        if (f.src.length < 1) {
          grunt.log.warn('Destination ' + chalk.cyan(destFile) + ' not written because no source files were found.');
        }

        // No src files, goto next target. Warn would have been issued above.
        return nextFileObj();
      }

      var compiled = [];
      var i = 0;

      async.concatSeries(files, function(file, next) {
        if (i++ > 0) {
          options.banner = '';
        }

        compileLess(file, destFile, options)
          .then(function(output) {
            compiled.push(output.css);
            if (options.sourceMap && !options.sourceMapFileInline) {
              var sourceMapFilename = options.sourceMapFilename;
              if (!sourceMapFilename) {
                sourceMapFilename = destFile + '.map';
              }
              grunt.file.write(sourceMapFilename, output.map);
              grunt.verbose.writeln('File ' + chalk.cyan(sourceMapFilename) + ' created.');
            }
            process.nextTick(next);
          },
          function(err) {
            nextFileObj(err);
          });
      }, function() {
        if (compiled.length < 1) {
          grunt.log.warn('Destination ' + chalk.cyan(destFile) + ' not written because compiled files were empty.');
        } else {
          var allCss = compiled.join(options.compress ? '' : grunt.util.normalizelf(grunt.util.linefeed));
          grunt.file.write(destFile, allCss);
          grunt.verbose.writeln('File ' + chalk.cyan(destFile) + ' created');
        }
        nextFileObj();
      });
<commit_msg>Revert "Use `grunt.verbose` instead of logging every created file."<commit_after>/*
 * grunt-contrib-less
 * http://gruntjs.com/
 *
 * Copyright (c) 2015 <NAME>, contributors
 * Licensed under the MIT license.
 */

'use strict';

var path = require('path');
var _ = require('lodash');
var async = require('async');
var chalk = require('chalk');
var less = require('less');

module.exports = function(grunt) {
  grunt.registerMultiTask('less', 'Compile LESS files to CSS', function() {
    var done = this.async();

    var options = this.options({
      banner: ''
    });

    if (this.files.length < 1) {
      grunt.verbose.warn('Destination not written because no source files were provided.');
    }

    async.eachSeries(this.files, function(f, nextFileObj) {
      var destFile = f.dest;

      var files = f.src.filter(function(filepath) {
        // Warn on and remove invalid source files (if nonull was set).
        if (!grunt.file.exists(filepath)) {
          grunt.log.warn('Source file "' + filepath + '" not found.');
          return false;
        } else {
          return true;
        }
      });

      if (files.length === 0) {
        if (f.src.length < 1) {
          grunt.log.warn('Destination ' + chalk.cyan(destFile) + ' not written because no source files were found.');
        }

        // No src files, goto next target. Warn would have been issued above.
        return nextFileObj();
      }

      var compiled = [];
      var i = 0;

      async.concatSeries(files, function(file, next) {
        if (i++ > 0) {
          options.banner = '';
        }

        compileLess(file, destFile, options)
          .then(function(output) {
            compiled.push(output.css);
            if (options.sourceMap && !options.sourceMapFileInline) {
              var sourceMapFilename = options.sourceMapFilename;
              if (!sourceMapFilename) {
                sourceMapFilename = destFile + '.map';
              }
              grunt.file.write(sourceMapFilename, output.map);
              grunt.log.writeln('File ' + chalk.cyan(sourceMapFilename) + ' created.');
            }
            process.nextTick(next);
          },
          function(err) {
            nextFileObj(err);
          });
      }, function() {
        if (compiled.length < 1) {
          grunt.log.warn('Destination ' + chalk.cyan(destFile) + ' not written because compiled files were empty.');
        } else {
          var allCss = compiled.join(options.compress ? '' : grunt.util.normalizelf(grunt.util.linefeed));
          grunt.file.write(destFile, allCss);
          grunt.log.writeln('File ' + chalk.cyan(destFile) + ' created');
        }
        nextFileObj();
      });

{'fraction_non_alphanumeric': 0.13699141470698023, 'fraction_numerical': 0.003732736095558044, 'mean_word_length': 2.1030689056166763, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, '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': '6385267', 'n_tokens_mistral': 1586, 'n_tokens_neox': 1547, 'n_words': 366}