Skip to content

DL3013: Fix false positives for VCS, http and local path packages (#389)#845

Merged
lorenzo merged 2 commits intohadolint:masterfrom
Lunkentuss:fix-pip-install
Jul 9, 2022
Merged

DL3013: Fix false positives for VCS, http and local path packages (#389)#845
lorenzo merged 2 commits intohadolint:masterfrom
Lunkentuss:fix-pip-install

Conversation

@Lunkentuss
Copy link
Copy Markdown
Contributor

@Lunkentuss Lunkentuss commented Jun 15, 2022

What I did

  • Fix false positive when installing package with other supported VCS
    such as: pip install bzr+ssh://..@1.0.0, as described in
    https://pip.pypa.io/en/stable/topics/vcs-support/.
  • Fix false positive when installing package from local directory:
    pip install my/install/path
  • Fix false positive when installing package from http/https url:
    pip install https://foo.bar/baz-1.0.0.zip

fixes #389

How I did it

Extended the previous check for a git+https vcs scheme to allow any of the supported vcs sources, such as git+ssh and bzr+ssh, documented in https://pip.pypa.io/en/stable/topics/vcs-support/. Also added passing check if a package source included a forward slash (/) but is not a valid vcs source.

How to verify it

Compare the supported VCS in this PR from the VCS supported from the pip documentation https://pip.pypa.io/en/stable/topics/vcs-support/. Also, the following Dockerfile illustrates cases where hadolint now runs without any warnings.

FROM python:3.10

RUN pip install --no-cache-dir \
  git+ssh://hello@1.3 \
  hello/bar/baz \
  https://foo.bar/baz-1.0.0.zip

Peter Hansson added 2 commits June 15, 2022 22:37
…dolint#389)

- Fix false positive when installing package with other supported VCS
  such as: `pip install bzr+ssh://..@1.0.0`, as described in
  https://pip.pypa.io/en/stable/topics/vcs-support/.
- Fix false positive when installing package from local directory:
  `pip install my/install/path`
- Fix false positive when installing package from http/https url:
  `pip install https://foo.bar/baz-1.0.0.zip`
@lorenzo
Copy link
Copy Markdown
Member

lorenzo commented Jul 9, 2022

thanks!

@lorenzo lorenzo merged commit cbf1479 into hadolint:master Jul 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pip install directory detected as DL3013

2 participants