Add recommendation to build-style.md about listing dependencies directly. RELNOTES: None. PiperOrigin-RevId: 165949361
diff --git a/site/docs/skylark/build-style.md b/site/docs/skylark/build-style.md index a74a045..93394a3 100644 --- a/site/docs/skylark/build-style.md +++ b/site/docs/skylark/build-style.md
@@ -136,6 +136,12 @@ [References to targets in the current package](#references-to-targets-in-the-current-package) section above (not by their absolute package name). +Prefer to list dependencies directly, as a single list. Putting the "common" +dependencies of several targets into a variable reduces maintainability, makes +it impossible for tools to change the dependencies of a target and can lead to +unused dependencies. + + ## Globs Do not use recursive globs (e.g., `glob(["**/*.java"])`). Recursive globs