pkgcore / pkgcheck

pkgcore-based QA utility for ebuild repos
https://pkgcore.github.io/pkgcheck
BSD 3-Clause "New" or "Revised" License
34 stars 29 forks source link

[New Check]: Check for self-assignment leading to blank value #626

Closed thesamesam closed 9 months ago

thesamesam commented 9 months ago

Is there an existing such new check request for this?

Explain

We want to catch trivial typos like RDEPEND="${RDEPEND}".

Examples

https://github.com/gentoo/gentoo/blob/4a9057157eb7b863d788cd488714a9fa1033d604/games-util/basis_universal/basis_universal-1.16.3.ebuild#L22

# zstd is bundled, see https://github.com/BinomialLLC/basis_universal/pull/228
DEPEND="
    opencl? ( virtual/opencl )
"
RDEPEND="${RDEPEND}" # <--- RDEPEND is now blank, should be RDEPEND="${DEPEND}"

Output message

SuspisciousSelfAssignment

Documentation

Variable is being assigned to itself, blanking the value.

Result level

warning

thesamesam commented 9 months ago

See also: