@@ -11,27 +11,30 @@ function FixMe() { }
1111
1212FixMe . prototype . runEngine = function ( ) {
1313 var analysisFiles = [ ] ,
14+ config = {
15+ include_paths : [ "./" ] ,
16+ strings : [ "FIXME" , "TODO" , "HACK" , "XXX" , "BUG" ]
17+ } ,
1418 self = this ;
1519
1620 if ( fs . existsSync ( '/config.json' ) ) {
17- var engineConfig = JSON . parse ( fs . readFileSync ( '/config.json' ) ) ;
21+ var overrides = JSON . parse ( fs . readFileSync ( '/config.json' ) ) ;
1822
19- if ( engineConfig . hasOwnProperty ( 'include_paths' ) ) {
20- analysisFiles = fileBuilder . withIncludes ( engineConfig . include_paths ) ;
21- } else if ( engineConfig . hasOwnProperty ( 'exclude_paths' ) ) {
22- analysisFiles = fileBuilder . withExcludes ( engineConfig . exclude_paths ) ;
23+ for ( var prop in overrides ) {
24+ config [ prop ] = overrides [ prop ] ;
2325 }
2426 }
2527
28+ analysisFiles = fileBuilder . withIncludes ( config . include_paths ) ;
2629 analysisFiles = fileBuilder . filterFiles ( analysisFiles ) ;
2730
2831 analysisFiles . forEach ( function ( f , i , a ) {
29- self . find ( f ) ;
32+ self . find ( f , config . strings ) ;
3033 } ) ;
3134}
3235
33- FixMe . prototype . find = function ( file ) {
34- var fixmeStrings = "'(FIXME|TODO|HACK|XXX|BUG )'" ,
36+ FixMe . prototype . find = function ( file , strings ) {
37+ var fixmeStrings = "'(" + strings . join ( "|" ) + " )'",
3538 self = this ;
3639
3740 // Prepare the grep string for execution (uses BusyBox grep)
0 commit comments