@@ -32,7 +32,7 @@ const os = require('os');
32
32
33
33
const isCI = process . env . TRAVIS === 'true' || process . env . TF_BUILD !== undefined ;
34
34
35
- const noop = function ( ) { } ;
35
+ const noop = function ( ) { } ;
36
36
/**
37
37
* Hygiene works by creating cascading subsets of all our files and
38
38
* passing them through a sequence of checks. Here are the current subsets,
@@ -72,7 +72,7 @@ gulp.task('compile', done => {
72
72
. on ( 'error' , ( ) => ( failed = true ) )
73
73
. js . pipe ( gulp . dest ( 'out' ) )
74
74
. on ( 'finish' , ( ) => ( failed ? done ( new Error ( 'TypeScript compilation errors' ) ) : done ( ) ) ) ;
75
- } ) ;
75
+ } ) ;
76
76
77
77
gulp . task ( 'precommit' , done => run ( { exitOnError : true , mode : 'staged' } , done ) ) ;
78
78
@@ -261,7 +261,7 @@ gulp.task('installPythonRequirements', async () => {
261
261
// See https://github.com/microsoft/vscode-python/issues/7136
262
262
gulp . task ( 'installNewPtvsd' , async ( ) => {
263
263
// Install new PTVSD with wheels for python 3.7
264
- const successWithWheels = await spawnAsync ( process . env . CI_PYTHON_PATH || 'python3' , './pythonFiles/install_ptvsd.py' )
264
+ const successWithWheels = await spawnAsync ( process . env . CI_PYTHON_PATH || 'python3' , [ './pythonFiles/install_ptvsd.py' ] )
265
265
. then ( ( ) => true )
266
266
. catch ( ex => {
267
267
console . error ( "Failed to install new PTVSD wheels using 'python3'" , ex ) ;
@@ -491,7 +491,7 @@ const hygiene = (options, done) => {
491
491
options = options || { } ;
492
492
let errorCount = 0 ;
493
493
494
- const indentation = es . through ( function ( file ) {
494
+ const indentation = es . through ( function ( file ) {
495
495
file . contents
496
496
. toString ( 'utf8' )
497
497
. split ( / \r \n | \r | \n / )
@@ -510,7 +510,7 @@ const hygiene = (options, done) => {
510
510
} ) ;
511
511
512
512
const formatOptions = { verify : true , tsconfig : true , tslint : true , editorconfig : true , tsfmt : true } ;
513
- const formatting = es . map ( function ( file , cb ) {
513
+ const formatting = es . map ( function ( file , cb ) {
514
514
tsfmt
515
515
. processString ( file . path , file . contents . toString ( 'utf8' ) , formatOptions )
516
516
. then ( result => {
@@ -568,15 +568,15 @@ const hygiene = (options, done) => {
568
568
}
569
569
570
570
const { linter, configuration } = getLinter ( options ) ;
571
- const tsl = es . through ( function ( file ) {
571
+ const tsl = es . through ( function ( file ) {
572
572
const contents = file . contents . toString ( 'utf8' ) ;
573
573
if ( isCI ) {
574
574
// Don't print anything to the console, we'll do that.
575
575
console . log ( '.' ) ;
576
576
}
577
577
// Yes this is a hack, but tslinter doesn't provide an option to prevent this.
578
578
const oldWarn = console . warn ;
579
- console . warn = ( ) => { } ;
579
+ console . warn = ( ) => { } ;
580
580
linter . failures = [ ] ;
581
581
linter . fixes = [ ] ;
582
582
linter . lint ( file . relative , contents , configuration . results ) ;
@@ -595,18 +595,18 @@ const hygiene = (options, done) => {
595
595
} ) ;
596
596
597
597
const tsFiles = [ ] ;
598
- const tscFilesTracker = es . through ( function ( file ) {
598
+ const tscFilesTracker = es . through ( function ( file ) {
599
599
tsFiles . push ( file . path . replace ( / \\ / g, '/' ) ) ;
600
600
tsFiles . push ( file . path ) ;
601
601
this . emit ( 'data' , file ) ;
602
602
} ) ;
603
603
604
604
const tsProject = getTsProject ( options ) ;
605
605
606
- const tsc = function ( ) {
606
+ const tsc = function ( ) {
607
607
function customReporter ( ) {
608
608
return {
609
- error : function ( error , typescript ) {
609
+ error : function ( error , typescript ) {
610
610
const fullFilename = error . fullFilename || '' ;
611
611
const relativeFilename = error . relativeFilename || '' ;
612
612
if ( tsFiles . findIndex ( file => fullFilename === file || relativeFilename === file ) === - 1 ) {
@@ -615,7 +615,7 @@ const hygiene = (options, done) => {
615
615
console . error ( `Error: ${ error . message } ` ) ;
616
616
errorCount += 1 ;
617
617
} ,
618
- finish : function ( ) {
618
+ finish : function ( ) {
619
619
// forget the summary.
620
620
console . log ( 'Finished compilation' ) ;
621
621
}
@@ -649,7 +649,7 @@ const hygiene = (options, done) => {
649
649
. pipe ( sourcemaps . init ( ) )
650
650
. pipe ( tsc ( ) )
651
651
. pipe (
652
- sourcemaps . mapSources ( function ( sourcePath , file ) {
652
+ sourcemaps . mapSources ( function ( sourcePath , file ) {
653
653
let tsFileName = path . basename ( file . path ) . replace ( / j s $ / , 'ts' ) ;
654
654
const qualifiedSourcePath = path
655
655
. dirname ( file . path )
@@ -669,7 +669,7 @@ const hygiene = (options, done) => {
669
669
. pipe ( sourcemaps . write ( '.' , { includeContent : false } ) )
670
670
. pipe ( gulp . dest ( dest ) )
671
671
. pipe (
672
- es . through ( null , function ( ) {
672
+ es . through ( null , function ( ) {
673
673
if ( errorCount > 0 ) {
674
674
const errorMessage = `Hygiene failed with errors 👎 . Check 'gulpfile.js' (completed in ${ new Date ( ) . getTime ( ) - started } ms).` ;
675
675
console . error ( colors . red ( errorMessage ) ) ;
@@ -879,5 +879,5 @@ exports.hygiene = hygiene;
879
879
880
880
// this allows us to run hygiene via CLI (e.g. `node gulfile.js`).
881
881
if ( require . main === module ) {
882
- run ( { exitOnError : true , mode : 'staged' } , ( ) => { } ) ;
882
+ run ( { exitOnError : true , mode : 'staged' } , ( ) => { } ) ;
883
883
}
0 commit comments