<commit_before>/*
 * grunt-dehoverify
 * https://github.com/lapple/grunt-dehoverify
 *
 * Copyright (c) 2014 <NAME>
 * Licensed under the MIT license.
 */

'use strict';

var rework = require('rework');
var walk = require('rework-walk');

module.exports = function(grunt) {

  grunt.registerMultiTask('dehoverify', function() {
    var options = this.options({});

    // Iterate over all specified file groups.
    this.files.forEach(function(f) {
      // Concat specified files.
      var src = 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;
        }
      }).map(function(filepath) {
        var css = grunt.file.read(filepath);

        return rework(css).use(dehoverify).toString({ compress: true });
      }).join(grunt.util.lineFeed);

      // Write the destination file.
      grunt.file.write(f.dest, src);

      // Print a success message.
      grunt.log.writeln('File "' + f.dest.cyan + '" created.');
    });
  });

};

function dehoverify(style) {
  walk(style, function(rule) {
    if (!rule.selectors) return;

    rule.selectors = rule.selectors.filter(function(selector) {
      return !(/\:hover/.test(selector));
    });

    if (rule.selectors.length === 0) {
      rule.declarations = [];
    }
  })
}<commit_msg>Fix jshint warnings<commit_after>/*
 * grunt-dehoverify
 * https://github.com/lapple/grunt-dehoverify
 *
 * Copyright (c) 2014 <NAME>
 * Licensed under the MIT license.
 */

'use strict';

var rework = require('rework');
var walk = require('rework-walk');

var dehoverify = function(style) {
  walk(style, function(rule) {
    if (!rule.selectors) {
      return;
    }

    rule.selectors = rule.selectors.filter(function(selector) {
      return !(/\:hover/.test(selector));
    });

    if (rule.selectors.length === 0) {
      rule.declarations = [];
    }
  });
};

module.exports = function(grunt) {

  grunt.registerMultiTask('dehoverify', function() {
    var options = this.options({});

    // Iterate over all specified file groups.
    this.files.forEach(function(f) {
      // Concat specified files.
      var src = 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;
        }
      }).map(function(filepath) {
        var css = grunt.file.read(filepath);

        return rework(css).use(dehoverify).toString({ compress: true });
      }).join(grunt.util.lineFeed);

      // Write the destination file.
      grunt.file.write(f.dest, src);

      // Print a success message.
      grunt.log.writeln('File "' + f.dest.cyan + '" created.');
    });
  });

};
{'fraction_non_alphanumeric': 0.15861837692823608, 'fraction_numerical': 0.00335345405767941, 'mean_word_length': 2.5301775147928995, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3582460', 'n_tokens_mistral': 959, 'n_tokens_neox': 939, 'n_words': 203}