@@ -490,6 +490,39 @@ step-maybe-generate-typescript-defs: &step-maybe-generate-typescript-defs
490490 fi
491491
492492# Lists of steps.
493+ steps-lint : &steps-lint
494+ steps :
495+ - *step-checkout-electron
496+ - run :
497+ name : Setup third_party Depot Tools
498+ command : |
499+ # "depot_tools" has to be checkout into "//third_party/depot_tools" so pylint.py can a "pylintrc" file.
500+ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git src/third_party/depot_tools
501+ echo 'export PATH="$PATH:'"$PWD"'/src/third_party/depot_tools"' >> $BASH_ENV
502+ - run :
503+ name : Download GN Binary
504+ command : |
505+ chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
506+ buildtools_revision="$(curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/DEPS?format=TEXT" | base64 -d | grep buildtools_revision -A1 | tr -d '\n' | cut -d\' -f4)"
507+
508+ git clone https://chromium.googlesource.com/chromium/buildtools "buildtools"
509+ (cd "buildtools" && git checkout "$buildtools_revision")
510+ echo 'export CHROMIUM_BUILDTOOLS_PATH="'"$PWD"'/buildtools"' >> $BASH_ENV
511+
512+ download_from_google_storage --bucket chromium-gn -s "buildtools/linux64/gn.sha1"
513+ - run :
514+ name : Run Lint
515+ command : |
516+ # gn.py tries to find a gclient root folder starting from the current dir.
517+ # When it fails and returns "None" path, the whole script fails. Let's "fix" it.
518+ touch .gclient
519+ # Another option would be to checkout "buildtools" inside the Electron checkout,
520+ # but then we would lint its contents (at least gn format), and it doesn't pass it.
521+
522+ cd src/electron
523+ npm install
524+ npm run lint
525+
493526steps-checkout : &steps-checkout
494527 steps :
495528 - *step-checkout-electron
@@ -776,6 +809,13 @@ chromium-upgrade-branches: &chromium-upgrade-branches
776809# List of all jobs.
777810version : 2
778811jobs :
812+ # Layer 0: Lint. Standalone.
813+ lint :
814+ << : *machine-linux-medium
815+ environment :
816+ << : *env-linux-medium
817+ << : *steps-lint
818+
779819 # Layer 1: Checkout.
780820 linux-checkout :
781821 << : *machine-linux-2xlarge
@@ -1300,6 +1340,10 @@ jobs:
13001340
13011341workflows :
13021342 version : 2
1343+ lint :
1344+ jobs :
1345+ - lint
1346+
13031347 build-linux :
13041348 jobs :
13051349 - linux-checkout
0 commit comments