Skip to content

Commit

Permalink
external_data: Enable test linting.
Browse files Browse the repository at this point in the history
  • Loading branch information
EricCousineau-TRI committed Jan 10, 2018
1 parent 3f6b4d1 commit 2ea52b5
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 15 deletions.
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ filegroup(
srcs = [
"BUILD.bazel",
"WORKSPACE",
".bazelproject",
],
visibility = ["//tools/external_data:__pkg__"],
)
Expand Down
16 changes: 3 additions & 13 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,9 @@ github_archive(
build_file = "tools/workspace/styleguide/styleguide.BUILD.bazel", # noqa
)

github_archive(
name = "pycodestyle",
repository = "PyCQA/pycodestyle",
commit = "2.3.1",
sha256 = "e9fc1ca3fd85648f45c0d2e33591b608a17d8b9b78e22c5f898e831351bacb03", # noqa
build_file = "tools/workspace/pycodestyle/pycodestyle.BUILD.bazel",
)
load("//tools/lint:lint_repositories.bzl", "lint_repositories")

lint_repositories()

bitbucket_archive(
name = "eigen",
Expand Down Expand Up @@ -323,12 +319,6 @@ github_archive(
build_file = "tools/workspace/yaml_cpp/yaml_cpp.BUILD.bazel",
)

load("//tools/workspace/buildifier:buildifier.bzl", "buildifier_repository")

buildifier_repository(
name = "buildifier",
)

load("//tools/workspace/gurobi:gurobi.bzl", "gurobi_repository")

gurobi_repository(
Expand Down
4 changes: 4 additions & 0 deletions tools/external_data/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ drake_workspace_files = [
":all_files",
"//tools/external_data/bazel_external_data:all_files",
"//tools:all_files",
"//tools/install:all_files",
"//tools/lint:all_files",
"//tools/skylark:all_files",
"//tools/workspace:all_files",
"//tools/workspace/buildifier:all_files",
"//tools/workspace/pycodestyle:all_files",
"//:skylark_files",
]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# -*- python -*-

load("@drake//tools/external_data:external_data.bzl", "external_data_stub_test")
load("@drake//tools/lint:lint.bzl", "add_lint_tests")
load(
"@drake//tools/external_data:external_data.bzl",
"external_data_stub_test",
)

external_data_stub_test()

add_lint_tests()
4 changes: 4 additions & 0 deletions tools/external_data/test/workspaces/bazel_pkg_test/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ local_repository(
name = "drake",
path = dirname(__workspace_dir__, 5),
)

load("@drake//tools/lint:lint_repositories.bzl", "lint_repositories")

lint_repositories()
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# -*- python -*-

# Empty BUILD file to declare this directory as a package.
load("@drake//tools/lint:lint.bzl", "add_lint_tests")

add_lint_tests()
3 changes: 3 additions & 0 deletions tools/install/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package(default_visibility = ["//visibility:public"])

load("//tools/lint:lint.bzl", "add_lint_tests")
load("//tools/skylark:meta.bzl", "all_files")

py_library(
name = "cpsutils",
Expand All @@ -24,3 +25,5 @@ exports_files(
)

add_lint_tests()

all_files()
26 changes: 26 additions & 0 deletions tools/lint/lint_repositories.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
load("//tools/workspace:github.bzl", "github_archive")
load("//tools/workspace/buildifier:buildifier.bzl", "buildifier_repository")

ALL = [
"pycodestyle",
"buildifier",
]

def lint_repositories(include = ALL):
if "pycodestyle" in include:
github_archive(
name = "pycodestyle",
repository = "PyCQA/pycodestyle",
commit = "2.3.1",
sha256 = "e9fc1ca3fd85648f45c0d2e33591b608a17d8b9b78e22c5f898e831351bacb03", # noqa
# `build_file` must be specified as a target `:` so that Bazel
# knows how to resolve it thorugh an external.
build_file = "@drake//tools/workspace/pycodestyle:pycodestyle.BUILD.bazel", # noqa
)

if "buildifier" in include:
buildifier_repository(
name = "buildifier",
)

# No repositories for `clang-format`. It is used via the system.
3 changes: 3 additions & 0 deletions tools/workspace/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ load(
"drake_py_binary",
)
load("//tools/lint:lint.bzl", "add_lint_tests")
load("//tools/skylark:meta.bzl", "all_files")

drake_py_binary(
name = "cmake_configure_file",
Expand Down Expand Up @@ -58,3 +59,5 @@ install(
check_licenses(_DRAKE_EXTERNAL_PACKAGE_INSTALLS)

add_lint_tests()

all_files()
3 changes: 3 additions & 0 deletions tools/workspace/buildifier/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
# neighboring *.bzl file can be loaded elsewhere.

load("//tools/lint:lint.bzl", "add_lint_tests")
load("//tools/skylark:meta.bzl", "all_files")

add_lint_tests()

all_files()
3 changes: 3 additions & 0 deletions tools/workspace/pycodestyle/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
# neighboring *.bzl file can be loaded elsewhere.

load("//tools/lint:lint.bzl", "add_lint_tests")
load("//tools/skylark:meta.bzl", "all_files")

add_lint_tests()

all_files()

0 comments on commit 2ea52b5

Please sign in to comment.