Back to all reviewers

Avoid variable name conflicts

docker/compose
Based on 2 comments
Other

Choose variable names that prevent conflicts with system variables, external tools, and variables in overlapping scopes. Use prefixes or distinct naming to differentiate purpose and avoid unintended overrides.

Naming Conventions Other

Reviewer Prompt

Choose variable names that prevent conflicts with system variables, external tools, and variables in overlapping scopes. Use prefixes or distinct naming to differentiate purpose and avoid unintended overrides.

For system/tool conflicts, use prefixed names:

# Instead of LDFLAGS (conflicts with rpm/deb packaging)
GO_LDFLAGS ?= -s -w -X ${PKG}/internal.Version=${VERSION}

For same-scope conflicts, use different names for different purposes:

# Instead of same name for ARG and ENV
ARG GIT_COMMIT=unknown
ENV DOCKER_COMPOSE_GITSHA=$GIT_COMMIT

This prevents situations where variables are unexpectedly overridden by external tools or conflicting declarations in the same context.

2
Comments Analyzed
Other
Primary Language
Naming Conventions
Category

Source Discussions