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

Color code the output #113

Open
kenden opened this issue Aug 16, 2018 · 1 comment
Open

Color code the output #113

kenden opened this issue Aug 16, 2018 · 1 comment

Comments

@kenden
Copy link

kenden commented Aug 16, 2018

Feature request:

In order to make the error more obvious, it would be nice to color them in red in the output.
Like shellcheck does:

image

Then as a user, it's quicker to see a problem.

version:

hadolint --version
Haskell Dockerfile Linter 1.11.0-no-git

@mikybars
Copy link

mikybars commented Oct 25, 2019

Nothing that a good old Python wrapper can't fix:

https://github.com/mperezi/spring-tasks-app/blob/dockerfile-best-practices/scripts/hadolint.py

Usage:

$ python hadolint.py Dockerfile          # uses the hadolint binary
$ python hadolint.py --docker Dockerfile # uses the dockerized version of hadolint

Expected output (console):

image

Expected output (pipe or file):

FROM openjdk:8
[x] DL3020: Use COPY instead of ADD for files and folders
ADD build/libs/spring-tasks-app-*.jar /app.jar
[!] DL3025: Use arguments JSON notation for CMD and ENTRYPOINT arguments
ENTRYPOINT java -jar /app.jar

You can always enforce no colors with:

$ python hadolint.py --color=never Dockerfile

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

2 participants