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

setting hadolintPath using variable ${workspaceFolder} does not work #86

Open
sanderegg opened this issue Mar 13, 2024 · 1 comment
Open
Assignees

Comments

@sanderegg
Copy link

Describe the bug
A clear and concise description of what the bug is.
I use hadolint via a bash script that runs hadolint in a docker container and it is located inside my repository

Therefore I have my settings.json file set as "hadolint.hadolintPath": "${workspaceFolder}/scripts/hadolint.bash"

Then I get the error hadolint: Cannot find adolint from system $PATH, ....
If I set an absolute path in "hadolint.hadolintPath": "/the/path/to/scripts/hadolint.bash" then it works.

but that is very annoying for sharing the directory of course.
To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behaviour
using ${workspaceFolder} should resolve

Environment and version (please complete the following information):

  • hadolint: <replace with output of hadolint --version>
  • OS: <windows, macOS, linux, etc>. Please be specific, for Windows you may include build number, for Linux you may include distribution name.
    ubuntu 22.04, latest vscode, latest hadolint/hadolint docker image
@ferrarimarco
Copy link

Hi! I'm getting the same error, although my use case is different.

Hadolint is installed as a binary in my devcontainer, and it's available in the PATH. I'm using the ${workspaceFolder} variable as part of the path to a workspace-specific Hadolint configuration. My configuration for the exiasr.hadolint extension is as follows:

"hadolint.cliOptions": [
  "--config",
  "${workspaceFolder}/config/lint/.hadolint.yaml"
]

With these settings, I get the following output:

[hadolint] hadolint: ${workspaceFolder}/config/lint/.hadolint.yaml: withBinaryFile: does not exist (No such file or directory)

If I use a fixed path for the configuration file option, hadolint works correctly:

"hadolint.cliOptions": [
  "--config",
  "/workspaces/workspace-name/config/lint/.hadolint.yaml"
]

In case it's helpful, here are some data points about the environment.

Environment and version (please complete the following information):

  • hadolint: Haskell Dockerfile Linter 2.12.0
  • OS: (linux) Debian 12
  • VS Code version: 1.92.2
  • exiasr.hadolint extension version: v1.1.2

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

3 participants