Skip to content

Commit 2e482d1

Browse files
committed
Fix buildifier setup
1 parent 3c61927 commit 2e482d1

5 files changed

Lines changed: 6 additions & 22 deletions

File tree

BUILD

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,13 @@
1-
load("@aspect_rules_lint//format:defs.bzl", "format_test")
21
load("@buildifier_prebuilt//:rules.bzl", "buildifier_test")
32

43
buildifier_test(
5-
name = "buildifier_native",
6-
diff_command = "diff -u",
4+
name = "buildifier",
75
exclude_patterns = [
86
"./.git/*",
97
],
108
lint_mode = "warn",
9+
lint_warnings = ["all"],
1110
mode = "diff",
1211
no_sandbox = True,
1312
workspace = "//:WORKSPACE",
1413
)
15-
16-
format_test(
17-
name = "format_test",
18-
# Temporary workaround for not being able to use -diff_command
19-
env = ["BUILDIFIER_DIFF='diff -u'"],
20-
no_sandbox = True,
21-
# TODO: extend with pylint
22-
starlark = "@buildifier_prebuilt//:buildifier",
23-
starlark_check_args = [
24-
"-lint=warn",
25-
"-warnings=all",
26-
"-mode=diff",
27-
# -u will always get passed to buildifier not diff_command
28-
#"-diff_command=\"diff -u\"",
29-
],
30-
workspace = "//:WORKSPACE",
31-
)

MODULE.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ bazel_dep(name = "rules_cc", version = "0.2.3")
2121

2222
bazel_dep(
2323
name = "buildifier_prebuilt",
24-
version = "6.4.0",
24+
version = "7.3.1",
2525
dev_dependency = True,
2626
)
27-
bazel_dep(name = "aspect_rules_lint", version = "1.11.0", dev_dependency = True)
2827

2928
codechecker_extension = use_extension(
3029
"//src:tools.bzl",

test/unit/generated_files/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ cc_binary(
4040
"genrule_header_consumer.cc",
4141
":genrule_header.h",
4242
],
43+
copts = ["-Wno-unused-variable"],
4344
)
4445

4546
codechecker_test(

test/unit/legacy/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ cc_library(
4646
cc_library(
4747
name = "test_lib",
4848
srcs = ["src/lib.cc"],
49+
copts = ["-Wno-unused-variable"],
4950
)
5051

5152
# Test defect in CTU mode

test/unit/virtual_include/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ cc_library(
3434
cc_library(
3535
name = "virtual_include",
3636
srcs = ["source.cc"],
37+
copts = ["-Wno-return-type"],
3738
deps = ["test_inc"],
3839
)
3940

0 commit comments

Comments
 (0)