@@ -11,27 +11,30 @@ function FixMe() { }
11
11
12
12
FixMe . prototype . runEngine = function ( ) {
13
13
var analysisFiles = [ ] ,
14
+ config = {
15
+ include_paths : [ "./" ] ,
16
+ strings : [ "FIXME" , "TODO" , "HACK" , "XXX" , "BUG" ]
17
+ } ,
14
18
self = this ;
15
19
16
20
if ( fs . existsSync ( '/config.json' ) ) {
17
- var engineConfig = JSON . parse ( fs . readFileSync ( '/config.json' ) ) ;
21
+ var overrides = JSON . parse ( fs . readFileSync ( '/config.json' ) ) ;
18
22
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 ] ;
23
25
}
24
26
}
25
27
28
+ analysisFiles = fileBuilder . withIncludes ( config . include_paths ) ;
26
29
analysisFiles = fileBuilder . filterFiles ( analysisFiles ) ;
27
30
28
31
analysisFiles . forEach ( function ( f , i , a ) {
29
- self . find ( f ) ;
32
+ self . find ( f , config . strings ) ;
30
33
} ) ;
31
34
}
32
35
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 ( "|" ) + " )'",
35
38
self = this ;
36
39
37
40
// Prepare the grep string for execution (uses BusyBox grep)
0 commit comments