<commit_before>#!/usr/bin/env node

/*eslint no-console: 0 */
'use strict'

const ecosys = require('../').Ecosystem
const repos = ecosys.getTrailpackList()

let exitCode = 0
let timer = new Date()

console.log('>> complete. time elapsed', (new Date() - timer), 'ms')
console.log('>> 1. cloning', repos.length, 'repositories from github')

const clones = ecosys.cloneTrailpacks(repos)
console.log('>> complete. time elapsed', (new Date() - timer), 'ms')
//console.log('>> git clone exit codes', exitCodes)
console.log('>> 3. installing', repos.length, 'trailpack repositories from npm')

exitCode += clones.reduce((sum, code) => sum + code, 0)

timer = new Date()
const packs = ecosys.npmInstallTrailpacks(repos)


console.log('>> complete. time elapsed', (new Date() - timer), 'ms')
//console.log('>> npm link exit codes', exitCodes)
console.log('>> 4. running nsp (nodesecurity.io) checks')

exitCode += packs.reduce((sum, code) => sum + code, 0)

timer = new Date()
const security = ecosys.checkNodeSecurity(repos)

console.log('>> complete. time elapsed', (new Date() - timer), 'ms')
console.log('>> 5. running tests on', repos.length, 'trailpacks')

exitCode += security.reduce((sum, code) => sum + code, 0)

timer = new Date()
const tests = ecosys.npmTestTrailpacks(repos)

exitCode += tests.reduce((sum, code) => sum + code, 0)
console.log('>> complete. time elapsed', (new Date() - timer), 'ms')
console.log()
console.log('Summary')

repos.forEach((repo, i) => {
  console.log(repo.name, '::', (exitCodes[i] ? 'FAIL' : 'PASS'))
})

console.log('exit code:', exitCode)
process.exit(exitCode)
<commit_msg>[eslint] fix exitCode reference<commit_after>#!/usr/bin/env node

/*eslint no-console: 0 */
'use strict'

const ecosys = require('../').Ecosystem
const repos = ecosys.getTrailpackList()

let exitCode = 0
let timer = new Date()

console.log('>> complete. time elapsed', (new Date() - timer), 'ms')
console.log('>> 1. cloning', repos.length, 'repositories from github')

const clones = ecosys.cloneTrailpacks(repos)
console.log('>> complete. time elapsed', (new Date() - timer), 'ms')
//console.log('>> git clone exit codes', exitCodes)
console.log('>> 3. installing', repos.length, 'trailpack repositories from npm')

exitCode += clones.reduce((sum, code) => sum + code, 0)

timer = new Date()
const packs = ecosys.npmInstallTrailpacks(repos)


console.log('>> complete. time elapsed', (new Date() - timer), 'ms')
//console.log('>> npm link exit codes', exitCodes)
console.log('>> 4. running nsp (nodesecurity.io) checks')

exitCode += packs.reduce((sum, code) => sum + code, 0)

timer = new Date()
const security = ecosys.checkNodeSecurity(repos)

console.log('>> complete. time elapsed', (new Date() - timer), 'ms')
console.log('>> 5. running tests on', repos.length, 'trailpacks')

exitCode += security.reduce((sum, code) => sum + code, 0)

timer = new Date()
const tests = ecosys.npmTestTrailpacks(repos)

exitCode += tests.reduce((sum, code) => sum + code, 0)
console.log('>> complete. time elapsed', (new Date() - timer), 'ms')
console.log()
console.log('Summary')

repos.forEach((repo, i) => {
  console.log(repo.name, '::', (tests[i].status ? 'FAIL' : 'PASS'))
})

console.log('exit code:', exitCode)
process.exit(exitCode)

{'fraction_non_alphanumeric': 0.1916075285405739, 'fraction_numerical': 0.006170934896636841, 'mean_word_length': 4.948623853211009, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 57, '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': '2031105', 'n_tokens_mistral': 1160, 'n_tokens_neox': 1083, 'n_words': 317}