X Tutup
Skip to content

Commit dba476e

Browse files
trop[bot]John Kleinschmidt
authored andcommitted
ci: run lint on CircleCI (electron#19059)
* ci: run lint on CircleCI * Fix lint errors
1 parent e31e98d commit dba476e

File tree

3 files changed

+47
-34
lines changed

3 files changed

+47
-34
lines changed

.circleci/config.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
493526
steps-checkout: &steps-checkout
494527
steps:
495528
- *step-checkout-electron
@@ -776,6 +809,13 @@ chromium-upgrade-branches: &chromium-upgrade-branches
776809
# List of all jobs.
777810
version: 2
778811
jobs:
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

13011341
workflows:
13021342
version: 2
1343+
lint:
1344+
jobs:
1345+
- lint
1346+
13031347
build-linux:
13041348
jobs:
13051349
- linux-checkout

.vsts/lint.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

docs/api/browser-window.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -903,11 +903,11 @@ Resizes and moves the window to the supplied bounds. Any properties that are not
903903
```javascript
904904
const { BrowserWindow } = require('electron')
905905
const win = new BrowserWindow()
906-
// set all bounds properties
906+
// set all bounds properties
907907
win.setBounds({ x: 440, y: 225, width: 800, height: 600 })
908-
// set a single bounds property
908+
// set a single bounds property
909909
win.setBounds({ width: 200 })
910-
// { x: 440, y: 225, width: 200, height: 600 }
910+
// { x: 440, y: 225, width: 200, height: 600 }
911911
console.log(win.getBounds())
912912
```
913913

0 commit comments

Comments
 (0)
X Tutup