Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False negatives for SC2086 - Double quote to prevent globbing and word splitting #984

Open
1 of 3 tasks
ento opened this issue Nov 9, 2023 · 0 comments
Open
1 of 3 tasks

Comments

@ento
Copy link

ento commented Nov 9, 2023

  • This is a bug report
  • This is a feature request
  • I searched existing issues before opening this one

Expected behavior

Running hadolint against this Dockerfile should report SC2086

FROM debian:10.0
ARG FOO
RUN python foo.py --foo $FOO

Actual behavior

SC2086 doesn't get reported

Steps to reproduce the behavior

Output of hadolint --version :

Installed via nix-shell

$ hadolint --version
Haskell Dockerfile Linter 2.12.0

Dockerfile (if relevant)

FROM debian:10.0
ARG FOO
RUN python foo.py --foo $FOO

Additional environment details (OS, stack version, etc.)

shellcheck's online playground reports SC2086 when you enter a similar script

#!/bin/sh
FOO=
python foo.py --foo $FOO

image

Removing ARG makes hadolint report SC2086

FROM debian:10.0 as debian
RUN python foo.py --foo $FOO
$ hadolint Dockerfile
Dockerfile:2 SC2086 info: Double quote to prevent globbing and word splitting.
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

No branches or pull requests

1 participant