Skip to content
This repository was archived by the owner on Dec 4, 2021. It is now read-only.

Commit b892cd4

Browse files
committed
Restructured to eliminate custom.js and fixed overall program
1 parent dc6db82 commit b892cd4

File tree

4 files changed

+136
-136
lines changed

4 files changed

+136
-136
lines changed

check.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ var fs = require('fs'),
1111
util = require('util'),
1212
Scope = require('./scope.js');
1313

14+
module.exports.Scope = Scope.Scope;
15+
1416
var Sinks = require('./danger.json').sinks;
1517
var Sources = require('./danger.json').sources;
1618

@@ -32,7 +34,7 @@ module.exports.setFlags = function(newFlags) {
3234

3335
if (flags.recursive) {
3436
// function to handle loading and traversing a file upon require()
35-
Scope.custom = require('./custom.js').push(function(scope, node, ce) { // require
37+
Scope.custom = Scope.custom.push(function(scope, node, ce) { // require
3638
if (ce.name != 'require')
3739
return false;
3840

@@ -181,14 +183,12 @@ module.exports.setFlags = function(newFlags) {
181183
if (flags.recursive)
182184
p = 'file://' + path.relative(Scope.Scope.baseFile.split('/').reverse().slice(1).reverse().join('/'), this.file) + ':' + p;
183185

184-
185186
// console.log(' ', '[' + type + ']', p, name, value ? value : '');
186187
console.log(' ', cs[type]?cs[type]('[' + type + ']'):colors.blue('[' + type + ']'),
187188
colors.grey(p), name, value ? value : '');
188189
};
189190
}
190191

191-
module.exports.Scope = Scope.Scope;
192192
};
193193

194194
// Traverses ast.

custom.js

Lines changed: 0 additions & 104 deletions
This file was deleted.

danger.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
"require\\([\\']hapi[\\']\\)\\.\\w+",
1212
"require\\([\\']express[\\']\\)\\.\\w+"
1313
],
14-
"sources": [
15-
{"process.argv": "process.argv"}
16-
]}
14+
"sources": {
15+
"process.argv": "process.argv"
16+
}}

0 commit comments

Comments
 (0)