mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
build: drop script/run-gn-format.py (#51263)
This commit is contained in:
@@ -78,7 +78,7 @@
|
||||
"gn-typescript-definitions": "npm run create-typescript-definitions && node script/cp.mjs electron.d.ts",
|
||||
"pre-flight": "pre-flight",
|
||||
"gn-check": "node ./script/gn-check.js",
|
||||
"gn-format": "python3 script/run-gn-format.py",
|
||||
"gn-format": "node ./script/lint.js --gn --fix",
|
||||
"precommit": "lint-staged",
|
||||
"preinstall": "node -e 'process.exit(0)'",
|
||||
"pretest": "npm run create-typescript-definitions",
|
||||
@@ -117,7 +117,7 @@
|
||||
],
|
||||
"*.{gn,gni}": [
|
||||
"npm run gn-check",
|
||||
"npm run gn-format"
|
||||
"node ./script/lint.js --gn --fix --only --"
|
||||
],
|
||||
"*.py": [
|
||||
"node script/lint.js --py --fix --only --"
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from lib.util import get_depot_tools_env
|
||||
|
||||
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
|
||||
|
||||
# Helper to run gn format on multiple files
|
||||
# (gn only formats a single file at a time)
|
||||
def main():
|
||||
new_env = get_depot_tools_env()
|
||||
new_env['DEPOT_TOOLS_WIN_TOOLCHAIN'] = '0'
|
||||
new_env['CHROMIUM_BUILDTOOLS_PATH'] = os.path.realpath(
|
||||
os.path.join(SOURCE_ROOT, '..', 'buildtools')
|
||||
)
|
||||
|
||||
for gn_file in sys.argv[1:]:
|
||||
subprocess.check_call(
|
||||
['gn', 'format', gn_file],
|
||||
env=new_env
|
||||
)
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
Reference in New Issue
Block a user