bug(docker): pip_install_keeping_cached_packages misses --no-cache
#7236
Labels
bug
Something isn't working
community
Community contribution
docker
Docker query
dockerfile
query
New query feature
The
pip_install_keeping_cached_packages
check looks only for--no-cache-dir
, but ignores the fact that pip lets you abbreviate its arguments, so--no-cache
works just as well.Expected Behavior
pip install --no-cache
should be sufficient to silence the warning:--no-cache
is an abbreviation of--no-cache-dir
. (Even--no-ca
would work;--no-c
is ambiguous with e.g.--no-color
)I suppose there's an argument that KICS should not encourage usage that could theoretically become ambiguous with a new version of pip, if the pip authors add a
--no-cache-update
argument or something, but this specific shortening seems pretty widely used – of 406k GitHub code search results forpip install "--no-cache"
, up to 109k of them appear to use the shortened form (pip install "--no-cache" NOT "--no-cache-dir"
).Actual Behavior
KICS complains that "When installing packages with pip, the '--no-cache-dir' flag should be set to make Docker images smaller".
Steps to Reproduce the Problem
Specifications
(N/A if not applicable)
The text was updated successfully, but these errors were encountered: