<commit_before>var reduce = require('lodash.reduce')
var decamelize = require('decamelize');
var baseConfig = require('./base-config');
var configBuilder = require('./config-builder');
var fs = require('mz/fs');
var path = require('path');
var sass = require('node-sass');

function importStatement(path) {
  return "@import '$1';\n".replace('$1', path);
}

function fakeBaseFile(modules, nebulaConfig) {
  var baseFile = configBuilder(nebulaConfig);

  modules.forEach(function(moduleName) {
    if (moduleName !== 'config') {
      baseFile += importStatement(moduleName);
    }
  });

  return baseFile + "\n";
}

module.exports = (entryFile, options) => new Promise( (resolve, reject) => {
  const modules = baseConfig.defaultModules.concat(entryFile);
  const allowedConfigKeys = Object.keys(baseConfig.variables);

  const outFile = options.outFile;
  const useSourceMap = typeof options.useSourceMap === 'undefined'
                      ? true
                      : options.useSourceMap;

  const nebulaConfig = reduce(options, (result, value, key) => {
    const sassKey = decamelize(key, '-');

    if (allowedConfigKeys.indexOf(sassKey) >= 0) {
      result[sassKey] = value;
    }

    return result;
  }, Object.assign({}, baseConfig.variables));

  const fakeEntryFile = fakeBaseFile(modules, nebulaConfig);

  sass.render({
    includePaths: [path.join(__dirname, '../scss')],
    outputStyle: 'compact',
    data: fakeEntryFile,
    sourceMap: useSourceMap,
    outFile: outFile
  }, function(err, output) {
    if (err) {
      reject(new Error(err));
      return;
    }

    if (outFile) {
      Promise.all([
        fs.writeFile(outFile, output.css, null),
        useSourceMap ? fs.writeFile(outFile + '.map', output.map, null) : null
      ]).catch(reject)
      .then(() => resolve(outFile));
    } else {
      resolve(output.css.toString());
    }
  });
});
<commit_msg>Linting errors<commit_after>var reduce = require('lodash.reduce');
var decamelize = require('decamelize');
var baseConfig = require('./base-config');
var configBuilder = require('./config-builder');
var fs = require('mz/fs');
var path = require('path');
var sass = require('node-sass');

function importStatement(importPath) {
  return "@import '$1';\n".replace('$1', importPath);
}

function fakeBaseFile(modules, nebulaConfig) {
  var baseFile = configBuilder(nebulaConfig);

  modules.forEach(function(moduleName) {
    if (moduleName !== 'config') {
      baseFile += importStatement(moduleName);
    }
  });

  return baseFile + '\n';
}

module.exports = (entryFile, options) => new Promise( (resolve, reject) => {
  const modules = baseConfig.defaultModules.concat(entryFile);
  const allowedConfigKeys = Object.keys(baseConfig.variables);

  const outFile = options.outFile;
  const useSourceMap = typeof options.useSourceMap === 'undefined'
                      ? true
                      : options.useSourceMap;

  const nebulaConfig = reduce(options, (result, value, key) => {
    const sassKey = decamelize(key, '-');

    if (allowedConfigKeys.indexOf(sassKey) >= 0) {
      result[sassKey] = value;
    }

    return result;
  }, Object.assign({}, baseConfig.variables));

  const fakeEntryFile = fakeBaseFile(modules, nebulaConfig);

  sass.render({
    includePaths: [path.join(__dirname, '../scss')],
    outputStyle: 'compact',
    data: fakeEntryFile,
    sourceMap: useSourceMap,
    outFile: outFile
  }, function(err, output) {
    if (err) {
      reject(new Error(err));
      return;
    }

    if (outFile) {
      Promise.all([
        fs.writeFile(outFile, output.css, null),
        useSourceMap ? fs.writeFile(outFile + '.map', output.map, null) : null
      ]).catch(reject)
      .then(() => resolve(outFile));
    } else {
      resolve(output.css.toString());
    }
  });
});

{'fraction_non_alphanumeric': 0.15459317585301838, 'fraction_numerical': 0.0015748031496062992, 'mean_word_length': 3.4006928406466512, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '2719314', 'n_tokens_mistral': 1198, 'n_tokens_neox': 1155, 'n_words': 247}