Skip to content

fix: misidentification of pipenv (#366)#940

Merged
m-ildefons merged 2 commits intohadolint:masterfrom
kthy:master
Feb 28, 2023
Merged

fix: misidentification of pipenv (#366)#940
m-ildefons merged 2 commits intohadolint:masterfrom
kthy:master

Conversation

@kthy
Copy link
Copy Markdown
Contributor

@kthy kthy commented Feb 27, 2023

What I did

Check that when we detect pip it's not actually pipenv. This fixes #366.

How I did it

Add an extra && not (…) check.

How to verify it

Run Hadolint on this Dockerfile:

FROM python:3.10
RUN pip install --no-cache-dir pipenv==2023.2.18 \
 && python3 -m venv /venv
RUN pipenv install --python 3.10 --keep-outdated --ignore-pipfile \
 && rm -rf /root/.cache/pipenv

It raises DL3013 on the current version of Hadolint and nothing on my fork.

(Caveat: I had to compile with a newer base package, but the change should be simple enough that it makes no difference.)

@kthy kthy mentioned this pull request Feb 27, 2023
3 tasks
@m-ildefons
Copy link
Copy Markdown
Member

Hi Kristian,
thanks a lot for this contribution. Would you be so kind and add tests in test/Hadolint/Rule/DL3013Spec.hs for this case too?
Other than that the code looks good to me.

@kthy
Copy link
Copy Markdown
Contributor Author

kthy commented Feb 27, 2023

This is my first time writing Haskell, so not really sure what you expect in the it "…" string. I've made a guess. 😊

@m-ildefons
Copy link
Copy Markdown
Member

That was quick 😄 , thanks a lot.

it is a test item and the string should be something to uniquely identify that particular test within the file. It can be used to re-run individual tests. Together with describe it should give an idea of what the test is trying to achieve, so you guessed quite good.
For more advanced usage, see the docs: https://hspec.github.io/writing-specs.html#using-describe-and-it

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.

Pin versions in pip linting error

2 participants