-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
61 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2024, University of Colorado Boulder | ||
|
||
const getRequiredArg = require( './getRequiredArg' ); | ||
const getBrands = require( './getBrands' ); | ||
const assert = require( 'assert' ); | ||
|
||
/** | ||
* @author Sam Reid (PhET Interactive Simulations) | ||
*/ | ||
const grunt = require( 'grunt' ); | ||
const repo = getRequiredArg( '--repo' ); | ||
|
||
const lint = require( '../lint' ); | ||
|
||
// --disable-eslint-cache disables the cache, useful for developing rules | ||
const cache = !grunt.option( 'disable-eslint-cache' ); | ||
const fix = grunt.option( 'fix' ); | ||
const chipAway = grunt.option( 'chip-away' ); | ||
assert && assert( !grunt.option( 'patterns' ), 'patterns not support for lint-all' ); | ||
|
||
const getPhetLibs = require( '../getPhetLibs' ); | ||
|
||
// Handle the lack of build.json | ||
let buildLocal; | ||
try { | ||
buildLocal = grunt.file.readJSON( `${process.env.HOME}/.phet/build-local.json` ); | ||
} | ||
catch( e ) { | ||
buildLocal = {}; | ||
} | ||
|
||
const brands = getBrands( grunt, repo, buildLocal ); | ||
|
||
( async () => { | ||
const lintReturnValue = await lint( getPhetLibs( repo, brands ), { | ||
cache: cache, | ||
fix: fix, | ||
chipAway: chipAway | ||
} ); | ||
|
||
// Output results on errors. | ||
if ( !lintReturnValue.ok ) { | ||
grunt.fail.fatal( 'Lint failed' ); | ||
} | ||
} )(); |