Skip to content

Commit

Permalink
Move sample PMD config into //java
Browse files Browse the repository at this point in the history
This means that users won't be exposed to the gazelle dependency in
the top-level build file.
  • Loading branch information
shs96c committed Dec 17, 2021
1 parent 06c1f60 commit d693d60
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
11 changes: 0 additions & 11 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary")
load("//java/private:pmd_ruleset.bzl", "pmd_ruleset")

pmd_ruleset(
name = "pmd-config",
rulesets = [
"pmd-ruleset.xml",
],
visibility = [
"//visibility:public",
],
)

gazelle_binary(
name = "gazelle_bin",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ load("@apple_rules_lint//lint:setup.bzl", "lint_setup")
lint_setup({
# Note: this is an example config!
"java-checkstyle": "@contrib_rules_jvm//java:checkstyle-default-config",
"java-pmd": "//:pmd-config",
"java-pmd": "@contrib_rules_jvm//java:pmd-config",
"java-spotbugs": "@contrib_rules_jvm//java:spotbugs-default-config",
})
```
Expand Down
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ load("@apple_rules_lint//lint:setup.bzl", "lint_setup")

lint_setup({
"java-checkstyle": "//java:checkstyle-default-config",
"java-pmd": "//:pmd-config",
"java-pmd": "//java:pmd-config",
"java-spotbugs": "//java:spotbugs-default-config",
})

Expand Down
2 changes: 1 addition & 1 deletion docs/preamble.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ load("@apple_rules_lint//lint:setup.bzl", "lint_setup")
lint_setup({
# Note: this is an example config!
"java-checkstyle": "@contrib_rules_jvm//java:checkstyle-default-config",
"java-pmd": "//:pmd-config",
"java-pmd": "@contrib_rules_jvm//java:pmd-config",
"java-spotbugs": "@contrib_rules_jvm//java:spotbugs-default-config",
})
```
Expand Down
11 changes: 11 additions & 0 deletions java/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("//java/private:artifact.bzl", "artifact")
load("//java/private:checkstyle_config.bzl", "checkstyle_config")
load("//java/private:spotbugs_config.bzl", "spotbugs_config")
load("//java/private:pmd_ruleset.bzl", "pmd_ruleset")

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

Expand Down Expand Up @@ -58,6 +59,16 @@ java_binary(
],
)

pmd_ruleset(
name = "pmd-config",
rulesets = [
"pmd-ruleset.xml",
],
visibility = [
"//visibility:public",
],
)

bzl_library(
name = "defs",
srcs = ["defs.bzl"],
Expand Down
File renamed without changes.

0 comments on commit d693d60

Please sign in to comment.