ci: use buildifier binary release (#27489)
Switch from Skylint to buildifier --lint - this is required for the Bazel 0.20 upgrade since Bazel no longer lets us use the embedded JDK to build and run Java programs, and Skylint is a Java program PR Close #27489
This commit is contained in:
parent
f6a67c9a84
commit
cab5927bd5
|
@ -53,21 +53,19 @@ version: 2
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
<<: *job_defaults
|
<<: *job_defaults
|
||||||
resource_class: xlarge
|
|
||||||
steps:
|
steps:
|
||||||
- checkout:
|
- checkout:
|
||||||
<<: *post_checkout
|
<<: *post_checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
key: *cache_key
|
key: *cache_key
|
||||||
- *define_env_vars
|
- *define_env_vars
|
||||||
- *setup_circleci_bazel_config
|
|
||||||
- *yarn_install
|
- *yarn_install
|
||||||
|
|
||||||
- run: 'yarn buildifier -mode=check ||
|
- run: 'yarn bazel:format -mode=check ||
|
||||||
(echo "BUILD files not formatted. Please run ''yarn buildifier''" ; exit 1)'
|
(echo "BUILD files not formatted. Please run ''yarn bazel:format''" ; exit 1)'
|
||||||
# Run the skylark linter to check our Bazel rules
|
# Run the skylark linter to check our Bazel rules
|
||||||
- run: 'yarn skylint ||
|
- run: 'yarn bazel:lint ||
|
||||||
(echo -e "\n.bzl files have lint errors. Please run ''yarn skylint''"; exit 1)'
|
(echo -e "\n.bzl files have lint errors. Please run ''yarn bazel:lint-fix''"; exit 1)'
|
||||||
|
|
||||||
- run: ./node_modules/.bin/gulp lint
|
- run: ./node_modules/.bin/gulp lint
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
workspace(name = "angular")
|
workspace(name = "angular")
|
||||||
|
|
||||||
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
||||||
load(
|
load(
|
||||||
"//packages/bazel:package.bzl",
|
"//packages/bazel:package.bzl",
|
||||||
"rules_angular_dependencies",
|
"rules_angular_dependencies",
|
||||||
|
|
|
@ -16,11 +16,9 @@
|
||||||
"url": "https://github.com/angular/angular.git"
|
"url": "https://github.com/angular/angular.git"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"preskylint": "bazel build --noshow_progress @io_bazel//src/tools/skylark/java/com/google/devtools/skylark/skylint:Skylint",
|
"bazel:format": "find . -type f \\( -name \"*.bzl\" -or -name BUILD -or -name BUILD.bazel -or -name WORKSPACE \\) ! -path \"*/node_modules/*\" | xargs buildifier -v",
|
||||||
"//": "deprecated-api is disabled because we use actions.new_file(genfiles_dir) which has no replacement, see https://github.com/bazelbuild/bazel/issues/4858",
|
"bazel:lint": "yarn bazel:format --lint=warn",
|
||||||
"skylint": "find . -type f -name \"*.bzl\" ! -path \"*/node_modules/*\" ! -path \"./dist/*\" | xargs $(bazel info bazel-bin)/external/io_bazel/src/tools/skylark/java/com/google/devtools/skylark/skylint/Skylint --disable-checks=deprecated-api",
|
"bazel:lint-fix": "yarn bazel:format --lint=fix",
|
||||||
"prebuildifier": "bazel build --noshow_progress @com_github_bazelbuild_buildtools//buildifier",
|
|
||||||
"buildifier": "find . -type f \\( -name \"*.bzl\" -or -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs $(bazel info bazel-bin)/external/com_github_bazelbuild_buildtools/buildifier/*/buildifier",
|
|
||||||
"preinstall": "node tools/yarn/check-yarn.js",
|
"preinstall": "node tools/yarn/check-yarn.js",
|
||||||
"postinstall": "yarn update-webdriver && node ./tools/postinstall-patches.js",
|
"postinstall": "yarn update-webdriver && node ./tools/postinstall-patches.js",
|
||||||
"update-webdriver": "webdriver-manager update --gecko false $CHROMEDRIVER_VERSION_ARG",
|
"update-webdriver": "webdriver-manager update --gecko false $CHROMEDRIVER_VERSION_ARG",
|
||||||
|
@ -91,6 +89,7 @@
|
||||||
"// 2": "devDependencies are not used under Bazel. Many can be removed after test.sh is deleted.",
|
"// 2": "devDependencies are not used under Bazel. Many can be removed after test.sh is deleted.",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@bazel/bazel": "^0.18.1",
|
"@bazel/bazel": "^0.18.1",
|
||||||
|
"@bazel/buildifier": "^0.19.2",
|
||||||
"@bazel/ibazel": "~0.8.2",
|
"@bazel/ibazel": "~0.8.2",
|
||||||
"@types/angular": "^1.6.47",
|
"@types/angular": "^1.6.47",
|
||||||
"@types/base64-js": "1.2.5",
|
"@types/base64-js": "1.2.5",
|
||||||
|
|
|
@ -74,21 +74,6 @@ def rules_angular_dev_dependencies():
|
||||||
url = "https://github.com/google/brotli/archive/v1.0.5.zip",
|
url = "https://github.com/google/brotli/archive/v1.0.5.zip",
|
||||||
)
|
)
|
||||||
|
|
||||||
# Fetching the Bazel source code allows us to compile the Skylark linter
|
|
||||||
http_archive(
|
|
||||||
name = "io_bazel",
|
|
||||||
sha256 = "978f7e0440dd82182563877e2e0b7c013b26b3368888b57837e9a0ae206fd396",
|
|
||||||
strip_prefix = "bazel-0.18.0",
|
|
||||||
url = "https://github.com/bazelbuild/bazel/archive/0.18.0.zip",
|
|
||||||
)
|
|
||||||
|
|
||||||
http_archive(
|
|
||||||
name = "com_github_bazelbuild_buildtools",
|
|
||||||
sha256 = "a82d4b353942b10c1535528b02bff261d020827c9c57e112569eddcb1c93d7f6",
|
|
||||||
strip_prefix = "buildtools-0.17.2",
|
|
||||||
url = "https://github.com/bazelbuild/buildtools/archive/0.17.2.zip",
|
|
||||||
)
|
|
||||||
|
|
||||||
#############################################
|
#############################################
|
||||||
# Dependencies for generating documentation #
|
# Dependencies for generating documentation #
|
||||||
#############################################
|
#############################################
|
||||||
|
|
18
yarn.lock
18
yarn.lock
|
@ -64,6 +64,24 @@
|
||||||
"@bazel/bazel-linux_x64" "0.18.0"
|
"@bazel/bazel-linux_x64" "0.18.0"
|
||||||
"@bazel/bazel-win32_x64" "0.18.0"
|
"@bazel/bazel-win32_x64" "0.18.0"
|
||||||
|
|
||||||
|
"@bazel/buildifier-darwin_x64@0.19.2":
|
||||||
|
version "0.19.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/@bazel/buildifier-darwin_x64/-/buildifier-darwin_x64-0.19.2.tgz#1182862b4a3578fb9367ab42e807131187a61702"
|
||||||
|
integrity sha512-f6CITRj8jFhhZFrQkIao3IgJjZAXGYwUkW/QBSeAu0HIltBerJ0FTt/Nmu9ji1QZYT2aO4RpZ8oJksG6xv1dcQ==
|
||||||
|
|
||||||
|
"@bazel/buildifier-linux_x64@0.19.2":
|
||||||
|
version "0.19.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/@bazel/buildifier-linux_x64/-/buildifier-linux_x64-0.19.2.tgz#8b26eaf1f091cd3846a7dd7ea94008b55498401e"
|
||||||
|
integrity sha512-kJjzbrjuAW4yVms5mbTWSHpJF6ogDLkuq4MjVP6a03umQ7E15o9YoxbDoiN+CzAj9ZMWPWfc5/N5TouiwXkGzA==
|
||||||
|
|
||||||
|
"@bazel/buildifier@^0.19.2":
|
||||||
|
version "0.19.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/@bazel/buildifier/-/buildifier-0.19.2.tgz#3e077de346ad98561cee703297aa8db50cfb3c76"
|
||||||
|
integrity sha512-MwkuoQdOdZ/VYKJvZe3qVCn3/20pLJyJpzNl3cBmaccWeUtdDKhtOm8YlLU08lxrt0VcKNcTYt4uiA62e/315A==
|
||||||
|
optionalDependencies:
|
||||||
|
"@bazel/buildifier-darwin_x64" "0.19.2"
|
||||||
|
"@bazel/buildifier-linux_x64" "0.19.2"
|
||||||
|
|
||||||
"@bazel/ibazel@~0.8.2":
|
"@bazel/ibazel@~0.8.2":
|
||||||
version "0.8.2"
|
version "0.8.2"
|
||||||
resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.8.2.tgz#a837d93922c0d273361ed4f141c792384c0e10bb"
|
resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.8.2.tgz#a837d93922c0d273361ed4f141c792384c0e10bb"
|
||||||
|
|
Loading…
Reference in New Issue