Skip to content

Commit

Permalink
Add buildifier test and fix issues to make it pass
Browse files Browse the repository at this point in the history
  • Loading branch information
adzenith committed Feb 1, 2024
1 parent 35e3ec1 commit d4abc10
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mypy.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"Public API"

load("@bazel_skylib//lib:shell.bzl", "shell")
load("@bazel_skylib//lib:sets.bzl", "sets")
load("@bazel_skylib//lib:shell.bzl", "shell")
load("//:rules.bzl", "MyPyStubsInfo")

MyPyAspectInfo = provider(
Expand All @@ -26,7 +26,7 @@ DEFAULT_ATTRS = {
"_mypy_cli": attr.label(
default = Label("//mypy"),
executable = True,
cfg = "host",
cfg = "exec",
),
"_mypy_config": attr.label(
default = Label("//:mypy_config"),
Expand Down
5 changes: 5 additions & 0 deletions test/shell/test_mypy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ test_ok_for_package_roots_regression() {
action_should_succeed build --aspects //:mypy.bzl%mypy_aspect --output_groups=mypy //test/foo:foo
}

test_ok_buildifier() {
action_should_succeed run //tools/buildifier:buildifier.check
}

test_fails_on_broken_mypy_typings() {
action_should_fail build --aspects //:mypy.bzl%mypy_aspect --output_groups=mypy //test:broken_mypy_typings
}
Expand Down Expand Up @@ -70,6 +74,7 @@ main() {
$runner test_ok_on_valid_imported_mypy_test
$runner test_ok_on_valid_mypy_test
$runner test_ok_on_empty_py_library
$runner test_ok_buildifier

$runner test_fails_on_broken_imported_mypy_typings
$runner test_fails_on_broken_imported_mypy_test
Expand Down

0 comments on commit d4abc10

Please sign in to comment.