Skip to content

Commit d693d60

Browse files
committed
Move sample PMD config into //java
This means that users won't be exposed to the gazelle dependency in the top-level build file.
1 parent 06c1f60 commit d693d60

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

BUILD.bazel

-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
22
load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary")
3-
load("//java/private:pmd_ruleset.bzl", "pmd_ruleset")
4-
5-
pmd_ruleset(
6-
name = "pmd-config",
7-
rulesets = [
8-
"pmd-ruleset.xml",
9-
],
10-
visibility = [
11-
"//visibility:public",
12-
],
13-
)
143

154
gazelle_binary(
165
name = "gazelle_bin",

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ load("@apple_rules_lint//lint:setup.bzl", "lint_setup")
3030
lint_setup({
3131
# Note: this is an example config!
3232
"java-checkstyle": "@contrib_rules_jvm//java:checkstyle-default-config",
33-
"java-pmd": "//:pmd-config",
33+
"java-pmd": "@contrib_rules_jvm//java:pmd-config",
3434
"java-spotbugs": "@contrib_rules_jvm//java:spotbugs-default-config",
3535
})
3636
```

WORKSPACE

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ load("@apple_rules_lint//lint:setup.bzl", "lint_setup")
1717

1818
lint_setup({
1919
"java-checkstyle": "//java:checkstyle-default-config",
20-
"java-pmd": "//:pmd-config",
20+
"java-pmd": "//java:pmd-config",
2121
"java-spotbugs": "//java:spotbugs-default-config",
2222
})
2323

docs/preamble.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ load("@apple_rules_lint//lint:setup.bzl", "lint_setup")
3030
lint_setup({
3131
# Note: this is an example config!
3232
"java-checkstyle": "@contrib_rules_jvm//java:checkstyle-default-config",
33-
"java-pmd": "//:pmd-config",
33+
"java-pmd": "@contrib_rules_jvm//java:pmd-config",
3434
"java-spotbugs": "@contrib_rules_jvm//java:spotbugs-default-config",
3535
})
3636
```

java/BUILD.bazel

+11
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
22
load("//java/private:artifact.bzl", "artifact")
33
load("//java/private:checkstyle_config.bzl", "checkstyle_config")
44
load("//java/private:spotbugs_config.bzl", "spotbugs_config")
5+
load("//java/private:pmd_ruleset.bzl", "pmd_ruleset")
56

67
package(default_visibility = ["//visibility:public"])
78

@@ -58,6 +59,16 @@ java_binary(
5859
],
5960
)
6061

62+
pmd_ruleset(
63+
name = "pmd-config",
64+
rulesets = [
65+
"pmd-ruleset.xml",
66+
],
67+
visibility = [
68+
"//visibility:public",
69+
],
70+
)
71+
6172
bzl_library(
6273
name = "defs",
6374
srcs = ["defs.bzl"],
File renamed without changes.

0 commit comments

Comments
 (0)