uiowaSEP2024 / 002_ImagePro

Image processing backend
1 stars 0 forks source link

Docker PreCommit Lint #157

Open mbrzus opened 5 months ago

mbrzus commented 5 months ago

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 commented 4 months ago

@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 commented 4 months ago

Have you tried files: 'Dockerfile_*' ?

mbrzus commented 4 months ago

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"