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

Docker PreCommit Lint #157

Open
mbrzus opened this issue Mar 29, 2024 · 3 comments
Open

Docker PreCommit Lint #157

mbrzus opened this issue Mar 29, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed W1 Easy

Comments

@mbrzus
Copy link
Contributor

mbrzus commented Mar 29, 2024

If this feature request related to a problem? Please describe.

Implement Hedolint into the pre-commit hooks to ensure clean dockerfile syntax and error catching

Rationale

Hedolint will ensure stable error-free syntax in our dockerfiles. It will help us catch errors faster and ensure stable code base and development standards.

Implementation Ideas
Follow the hedolint precommit resources https://github.com/hadolint/hadolint/blob/master/.pre-commit-hooks.yaml

@mbrzus mbrzus added enhancement New feature or request W1 Easy labels Mar 29, 2024
@mbrzus mbrzus self-assigned this Mar 29, 2024
@mbrzus mbrzus added the help wanted Extra attention is needed label Apr 1, 2024
@mbrzus
Copy link
Contributor Author

mbrzus commented Apr 1, 2024

@powersaudrey25 @Ivan-E-Johnson @zmorris248 I am struggling to get it to work.

This is the code snippet added to the .pre-commit file

# Hadolint for dockers
-   repo: https://github.com/hadolint/hadolint
    rev: v2.12.0
    hooks:
    -   id: hadolint-docker
        entry: hadolint/hadolint:v2.12.0 hadolint

It runs without error, BUT, it says:
Lint Dockerfiles.....................................(no files to check)Skipped

I tried to add the line:
files: '^Dockerfile.*'
to point it to our dockerfiles but it still says no files to check

@powersaudrey25
Copy link
Contributor

Have you tried
files: 'Dockerfile_*' ?

@mbrzus
Copy link
Contributor Author

mbrzus commented Apr 1, 2024

Have you tried files: 'Dockerfile_*' ?

Yes, I tried many different ways I was able to find online but everytime I get the "no files to check"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed W1 Easy
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants