Skip to content

Commit af6645a

Browse files
committed
Read config from JSON file
1 parent 2bea750 commit af6645a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
var glob = require('glob');
22
var exec = require('child_process').exec;
3+
var fs = require('fs');
34

45
module.exports = FixMe;
56
function FixMe() { }
67

78
// Strings to scan for in source
8-
var fixmeStrings = "'FIXME|TODO|HACK|BUG'";
9+
var fixmeStrings = "'FIXME|TODO|HACK|XXX|BUG'";
910

1011
// Prints properly structured Issue data to STDOUT according to
1112
// Code Climate Engine specification.
@@ -73,10 +74,10 @@ var fileWalk = function(excludePaths){
7374

7475
FixMe.prototype.runEngine = function(){
7576
// Pull engine config from env for exclude files
76-
var config = JSON.parse(process.env.ENGINE_CONFIG);
77+
var engineConfig = JSON.parse(fs.readFileSync("/config.json"));
7778

7879
// Walk /code/ path and find files to analyze
79-
var analysisFiles = fileWalk(config.exclude_paths);
80+
var analysisFiles = fileWalk(engineConfig.exclude_paths);
8081

8182
// Execute main loop and find fixmes in valid files
8283
analysisFiles.forEach(function(f, i, a){

0 commit comments

Comments
 (0)