<commit_before>/**
 * Description - Verifies that package.json does not contain a fatal error.
 * @param {string} projectName - name of project to verify
 * @param {string} dir - directory that contains project to be verified
 * @param {function} done - callback to be invoked with error
 **/

var fs = require('fs');

module.exports = function (packagePath, done) {
  if (!packagePath) return done();
  
  var metaPath = findFileSync((packagePath || process.cwd()), 'package.json', ['.git', 'node_modules']);
  var blackList = [{word: 'forever', level: 'FATAL'}, {word: 'pm2', level: 'FATAL'}];
  var meta;
  try {
    meta = JSON.parse(fs.readFileSync(metaPath), 'utf8');
  } catch (e) {
    return done();
  }
  
  var matches = [];
  blackList.forEach(function(elem) {
    if(meta.scripts.start.match(new RegExp(elem.word, 'g'))) {
      matches.push(elem);
    }
  });
  
  return done(null, matches);
}<commit_msg>add messages for forever and pm2<commit_after>/**
 * Description - Verifies that package.json does not contain a fatal error.
 * @param {string} projectName - name of project to verify
 * @param {string} dir - directory that contains project to be verified
 * @param {function} done - callback to be invoked with error
 **/

var fs = require('fs');

module.exports = function (packagePath, done) {
  if (!packagePath) return done();
  
  var metaPath = findFileSync((packagePath || process.cwd()), 'package.json', ['.git', 'node_modules']);
  var blackList = [{word: 'forever', level: 'FATAL', message: 'Your application is currently configured ' + 
    'to run using forever, which is not supported on Modulus. Please change your start script to simply ' + 
    'start the application and we\'ll handle the rest.'},
    {word: 'pm2', level: 'FATAL', message: 'Your application is currently '
    + 'configured to run using pm2, which is not supported on Modulus. Please ' 
    + 'change your start script to simply start the application and we\'ll handle the rest.'}];
  var meta;
  try {
    meta = JSON.parse(fs.readFileSync(metaPath), 'utf8');
  } catch (e) {
    return done();
  }
  
  var matches = [];
  blackList.forEach(function(elem) {
    if(meta.scripts.start.match(new RegExp(elem.word, 'g'))) {
      matches.push(elem);
    }
  });
  
  return done(null, matches);
}
{'fraction_non_alphanumeric': 0.14335360556038226, 'fraction_numerical': 0.0026064291920069507, 'mean_word_length': 3.7096114519427403, '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': '3487150', 'n_tokens_mistral': 704, 'n_tokens_neox': 700, 'n_words': 239}