-
Notifications
You must be signed in to change notification settings - Fork 4
Add Buildifier #187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Buildifier #187
Changes from all commits
c4fb9c1
9cb85a7
9adf43c
b12ca34
74e172b
78b9f0e
bc56ad8
79de248
ab52ba8
8128fa9
9352aa5
832533b
dbd2b03
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| 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", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May I ask why do we need this? |
||
| exclude_patterns = [ | ||
| "./.git/*", | ||
| ], | ||
| lint_mode = "warn", | ||
| 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\"", | ||
| ], | ||
| workspace = "//:WORKSPACE", | ||
| ) | ||
|
Comment on lines
+16
to
+31
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like not needed |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,13 @@ module(name = "rules_codechecker") | |
| bazel_dep(name = "rules_python", version = "0.32.0") | ||
| bazel_dep(name = "rules_cc", version = "0.2.3") | ||
|
|
||
| bazel_dep( | ||
| name = "buildifier_prebuilt", | ||
| version = "6.4.0", | ||
| dev_dependency = True, | ||
| ) | ||
| bazel_dep(name = "aspect_rules_lint", version = "1.11.0", dev_dependency = True) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we do not need this. This is actually duplication of buildifier_prebuilt |
||
|
|
||
| codechecker_extension = use_extension( | ||
| "//src:tools.bzl", | ||
| "module_register_default_codechecker", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why it is named "_native"?
Any reasons for that?