Skip to content
Merged
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
12 changes: 6 additions & 6 deletions nodejs/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ load("//nodejs:node_arch.bzl", "node_arch")

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

NODEJS_MAJOR_VERISONS = ("20", "22", "24")
NODEJS_MAJOR_VERSIONS = ("20", "22", "24")

MODE = [
"",
Expand All @@ -28,7 +28,7 @@ USER = [
)
for mode in MODE
for user in USER
for major_version in NODEJS_MAJOR_VERISONS
for major_version in NODEJS_MAJOR_VERSIONS
for distro in DISTROS
]

Expand All @@ -43,7 +43,7 @@ USER = [
)
for mode in MODE
for user in USER
for major_version in NODEJS_MAJOR_VERISONS
for major_version in NODEJS_MAJOR_VERSIONS
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While you're fixing the variable name, I noticed that the surrounding iteration logic is repeated in several places throughout this file (e.g., lines 29-32, 44-48, 65-69). This code duplication can make the build file harder to maintain in the long run.

As a suggestion for future improvement, you could consider refactoring this logic into a Starlark macro in a .bzl file. The macro could encapsulate the common iteration logic and generate the targets. This would centralize the logic and make future changes easier.

for arch in node_arch(major_version)
for distro in DISTROS
]
Expand All @@ -64,7 +64,7 @@ USER = [
)
for mode in MODE
for user in USER
for major_version in NODEJS_MAJOR_VERISONS
for major_version in NODEJS_MAJOR_VERSIONS
for arch in node_arch(major_version)
for distro in DISTROS
]
Expand All @@ -84,7 +84,7 @@ pkg_tar(
)
for mode in MODE
for user in USER
for major_version in NODEJS_MAJOR_VERISONS
for major_version in NODEJS_MAJOR_VERSIONS
for arch in node_arch(major_version)
for distro in DISTROS
]
Expand All @@ -101,7 +101,7 @@ pkg_tar(
)
for mode in MODE
for user in USER
for major_version in NODEJS_MAJOR_VERISONS
for major_version in NODEJS_MAJOR_VERSIONS
for arch in node_arch(major_version)
for distro in DISTROS
]
Loading