parent
6de393b2b8
commit
a53a559f5a
|
@ -42,19 +42,18 @@ version: 2
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
<<: *job_defaults
|
<<: *job_defaults
|
||||||
|
resource_class: xlarge
|
||||||
steps:
|
steps:
|
||||||
- checkout:
|
- checkout:
|
||||||
<<: *post_checkout
|
<<: *post_checkout
|
||||||
|
- run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
|
||||||
|
|
||||||
# Check BUILD.bazel formatting before we have a node_modules directory
|
# Check BUILD.bazel formatting before we have a node_modules directory
|
||||||
# Then we don't need any exclude pattern to avoid checking those files
|
# Then we don't need any exclude pattern to avoid checking those files
|
||||||
- run: 'buildifier -mode=check $(find . -type f \( -name "*.bzl" -or -name BUILD.bazel -or -name BUILD \)) ||
|
- run: 'yarn buildifier -mode=check ||
|
||||||
(echo "BUILD files not formatted. Please run ''yarn buildifier''" ; exit 1)'
|
(echo "BUILD files not formatted. Please run ''yarn buildifier''" ; exit 1)'
|
||||||
# Run the skylark linter to check our Bazel rules
|
# Run the skylark linter to check our Bazel rules
|
||||||
# deprecated-api is disabled because we use actions.new_file(genfiles_dir)
|
- run: 'yarn skylint ||
|
||||||
# which has no replacement, see https://github.com/bazelbuild/bazel/issues/4858
|
|
||||||
- run: 'find . -type f -name "*.bzl" |
|
|
||||||
xargs java -jar /usr/local/bin/Skylint_deploy.jar --disable-checks=deprecated-api ||
|
|
||||||
(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 skylint''"; exit 1)'
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"preskylint": "bazel build --noshow_progress @io_bazel//src/tools/skylark/java/com/google/devtools/skylark/skylint:Skylint",
|
"preskylint": "bazel build --noshow_progress @io_bazel//src/tools/skylark/java/com/google/devtools/skylark/skylint:Skylint",
|
||||||
|
"//": "deprecated-api is disabled because we use actions.new_file(genfiles_dir) which has no replacement, see https://github.com/bazelbuild/bazel/issues/4858",
|
||||||
"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",
|
"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",
|
||||||
"prebuildifier": "bazel build --noshow_progress @com_github_bazelbuild_buildtools//buildifier",
|
"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",
|
"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",
|
||||||
|
|
|
@ -23,6 +23,7 @@ RUN echo "deb http://deb.debian.org/debian stretch main contrib" > /etc/apt/sour
|
||||||
|
|
||||||
###
|
###
|
||||||
# Buildifier
|
# Buildifier
|
||||||
|
# TODO(alexeagle): remove this when all users use their locally built buildifier
|
||||||
# BUILD file formatter
|
# BUILD file formatter
|
||||||
# 'bazel clean --expunge' conserves size of the image
|
# 'bazel clean --expunge' conserves size of the image
|
||||||
RUN git clone https://github.com/bazelbuild/buildtools.git \
|
RUN git clone https://github.com/bazelbuild/buildtools.git \
|
||||||
|
@ -34,6 +35,7 @@ RUN git clone https://github.com/bazelbuild/buildtools.git \
|
||||||
|
|
||||||
###
|
###
|
||||||
# Skylint
|
# Skylint
|
||||||
|
# TODO(alexeagle): remove this when all users use their locally built skylint
|
||||||
# .bzl file linter
|
# .bzl file linter
|
||||||
# Follows readme at https://github.com/bazelbuild/bazel/blob/master/site/docs/skylark/skylint.md#building-the-linter
|
# Follows readme at https://github.com/bazelbuild/bazel/blob/master/site/docs/skylark/skylint.md#building-the-linter
|
||||||
# 'bazel clean --expunge' conserves size of the image
|
# 'bazel clean --expunge' conserves size of the image
|
||||||
|
|
Loading…
Reference in New Issue