Skip to content

Commit

Permalink
don't format select repos without js folders, phetsims/phet-info#150
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Dec 18, 2020
1 parent f992a65 commit 9434df2
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions js/grunt/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' ],
Expand Down Expand Up @@ -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 )
);
}
} );

};

0 comments on commit 9434df2

Please sign in to comment.