michaellzc / vscode-hadolint

VSCode extension to integrate hadolint, a Dockerfile linter, into VSCode
https://marketplace.visualstudio.com/items?itemName=exiasr.hadolint
MIT License
78 stars 5 forks source link

color code added in hadolint v1.23.0 #44

Closed yamap55 closed 3 years ago

yamap55 commented 3 years ago

hadolint v1.23.0 color option has been added. Therefore, the color code will be displayed when an error is pointed out. The --no-color option has been added, so please use it.

image1

https://github.com/hadolint/hadolint/releases/tag/v1.23.0

EGrunzkeCvg commented 3 years ago

The extra color characters also appear in the Problems Panel

michaellzc commented 3 years ago

The new version will add a new configuration option hadolint.cliOptions with a default value of ["--no-color"].

In the event of an error when calling hadolint, the fallback strategy is retrying without the --no-color flag. Additionally, it will display a warning message to suggest user looking into this issue.

For future references,

If you are a docker user or you use some custom script as hadolint executable, please modify your script accordingly and remove the --no-color option from the extension configuraion. Below is an example

#!/bin/bash

docker run --rm -i hadolint/hadolint hadolint \
  --no-color \
  - < "$@"

For regular users, please consider upgrading to the latest hadolint or manually remove the default --no-color from the hadolint.cliOptions configuration

cs-shadowbq commented 3 years ago

make sure the cliOptions are empty as below:

"hadolint.cliOptions": [],

KTamas commented 1 year ago

EDIT: solved the issue by moving all my customizations to $HOME/.config/hadolint.yaml instead.


I'm suddenly getting the error

Please visit [ExiaSR/vscode-hadolint#44](https://github.com/ExiaSR/vscode-hadolint/issues/44#issuecomment-808756114). You may be using an outdated version of hadolint or you are running hadolint in Docker```

I am not running an outdated version of hadolint:

$ hadolint --version
Haskell Dockerfile Linter 2.12.0

I have the following settings set:

  "hadolint.cliOptions": ["--no-color", "--ignore DL3008", "--ignore DL3016"],
  "hadolint.hadolintPath": "/opt/homebrew/bin/hadolint"

What am I doing wrong?

bendem commented 1 year ago

I'm confused image

> ~/.local/bin/hadolint --version
Haskell Dockerfile Linter 2.12.0

> file ~/.local/bin/hadolint
/home/demarteaub/.local/bin/hadolint: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped

I'm using the latest compiled version of hadolint from my system, and I'm getting told I'm not and that I need to change things. What's up?