Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ jobs:

- name: Analyzing the code with Buildifier
run: |
bazel test //:format_test --test_output=errors
bazel test //:buildifier --test_output=all

# TODO: Add more linters here
23 changes: 3 additions & 20 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,31 +1,14 @@
load("@aspect_rules_lint//format:defs.bzl", "format_test")
load("@buildifier_prebuilt//:rules.bzl", "buildifier_test")

buildifier_test(
name = "buildifier_native",
diff_command = "diff -u",
Comment thread
furtib marked this conversation as resolved.
name = "buildifier",
exclude_patterns = [
"./.git/*",
],
lint_mode = "warn",
lint_warnings = ["all"],
mode = "diff",
no_sandbox = True,
workspace = "//:WORKSPACE",
)

format_test(
name = "format_test",
# Temporary workaround for not being able to use -diff_command
env = ["BUILDIFIER_DIFF='diff -u'"],
no_sandbox = True,
# TODO: extend with pylint
starlark = "@buildifier_prebuilt//:buildifier",
starlark_check_args = [
"-lint=warn",
"-warnings=all",
"-mode=diff",
# -u will always get passed to buildifier not diff_command
#"-diff_command=\"diff -u\"",
],
verbose = True,
workspace = "//:WORKSPACE",
)
Comment thread
furtib marked this conversation as resolved.
3 changes: 1 addition & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ bazel_dep(name = "rules_cc", version = "0.2.3")

bazel_dep(
name = "buildifier_prebuilt",
version = "6.4.0",
version = "7.3.1",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct me if I'm wrong, but Buildifier versions are matching their Bazel "counterpart".

This is why I choose 6.4 to match the lowest version we still support.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I'm actually not sure there are matching, but you might be right

dev_dependency = True,
)
bazel_dep(name = "aspect_rules_lint", version = "1.11.0", dev_dependency = True)

codechecker_extension = use_extension(
"//src:tools.bzl",
Expand Down
1 change: 1 addition & 0 deletions test/unit/generated_files/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ cc_binary(
"genrule_header_consumer.cc",
":genrule_header.h",
],
copts = ["-Wno-unused-variable"],
)

codechecker_test(
Expand Down
1 change: 1 addition & 0 deletions test/unit/legacy/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ cc_library(
cc_library(
name = "test_lib",
srcs = ["src/lib.cc"],
copts = ["-Wno-unused-variable"],
)

# Test defect in CTU mode
Expand Down
1 change: 1 addition & 0 deletions test/unit/virtual_include/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ cc_library(
cc_library(
name = "virtual_include",
srcs = ["source.cc"],
copts = ["-Wno-return-type"],
deps = ["test_inc"],
)

Expand Down
Loading