File tree Expand file tree Collapse file tree 3 files changed +7
-19
lines changed Expand file tree Collapse file tree 3 files changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -6,14 +6,6 @@ function withIncludes(include_paths) {
66 return buildFiles ( include_paths ) ;
77}
88
9- // Returns file paths based on the exclude_paths values in config file
10- function withExcludes ( exclude_paths ) {
11- var allFiles = glob . sync ( "/code/**/**" , { } ) ;
12- var excludedFiles = buildFiles ( exclude_paths ) ;
13-
14- return diff ( allFiles , excludedFiles ) ;
15- }
16-
179// Returns all the file paths in the main directory that match the given pattern
1810function buildFiles ( paths ) {
1911 var files = [ ] ;
@@ -35,7 +27,6 @@ function filterFiles(paths) {
3527
3628module . exports = {
3729 withIncludes : withIncludes ,
38- withExcludes : withExcludes ,
3930 filterFiles : filterFiles
4031} ;
4132
Original file line number Diff line number Diff line change @@ -11,18 +11,20 @@ function FixMe() { }
1111
1212FixMe . prototype . runEngine = function ( ) {
1313 var analysisFiles = [ ] ,
14+ config = {
15+ include_paths : [ "./" ]
16+ } ,
1417 self = this ;
1518
1619 if ( fs . existsSync ( '/config.json' ) ) {
17- var engineConfig = JSON . parse ( fs . readFileSync ( '/config.json' ) ) ;
20+ var overrides = JSON . parse ( fs . readFileSync ( '/config.json' ) ) ;
1821
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 ) ;
22+ for ( var prop in overrides ) {
23+ config [ prop ] = overrides [ prop ] ;
2324 }
2425 }
2526
27+ analysisFiles = fileBuilder . withIncludes ( config . include_paths ) ;
2628 analysisFiles = fileBuilder . filterFiles ( analysisFiles ) ;
2729
2830 analysisFiles . forEach ( function ( f , i , a ) {
Original file line number Diff line number Diff line change @@ -7,11 +7,6 @@ describe("fileBuilder", function(){
77 // expect();
88 } ) ;
99 } ) ;
10- describe ( "#withExcludes(paths)" , function ( ) {
11- xit ( "returns correct files" , function ( ) {
12- // expect();
13- } ) ;
14- } ) ;
1510 describe ( "#filterFiles(paths)" , function ( ) {
1611 xit ( "returns filters out directory paths" , function ( ) {
1712 // expect();
You can’t perform that action at this time.
0 commit comments