From 9434df2b22771f5706424a456871e8c61ac4d797 Mon Sep 17 00:00:00 2001 From: zepumph Date: Thu, 17 Dec 2020 17:34:24 -0900 Subject: [PATCH] don't format select repos without js folders, https://github.com/phetsims/phet-info/issues/150 --- js/grunt/format.js | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/js/grunt/format.js b/js/grunt/format.js index 6a0cc0586..d4f443613 100644 --- a/js/grunt/format.js +++ b/js/grunt/format.js @@ -14,6 +14,22 @@ const fs = require( 'fs' ); const grunt = require( 'grunt' ); const sortImports = require( './sortImports' ); +// TODO: copied from lint.js, for testing right now, see https://github.com/phetsims/phet-info/issues/150 +const NO_FORMAT_REPOS = [ // don't format these repos + 'babel', + 'decaf', + 'eliot', + 'phet-android-app', + 'phet-info', + 'phet-io-client-guides', + 'phet-io-wrapper-arithmetic', + 'phet-io-wrapper-hookes-law-energy', + 'phet-ios-app', + 'sherpa', + 'smithers', + 'tasks' +]; + const OPTIONS = { 'html': { 'allowed_file_extensions': [ 'htm', 'html', 'xhtml', 'shtml', 'xml', 'svg' ], @@ -82,10 +98,11 @@ function formatFile( absPath, verifyOnly = false ) { module.exports = function( repos, verifyOnly = false ) { repos.forEach( repo => { - grunt.file.recurse( - `../${repo}/js`, - absPath => formatFile( absPath, verifyOnly ) - ); + if ( !NO_FORMAT_REPOS.includes( repo ) ) { + grunt.file.recurse( + `../${repo}/js`, + absPath => formatFile( absPath, verifyOnly ) + ); + } } ); - };