eve icon indicating copy to clipboard operation
eve copied to clipboard

Add linter for Dockerfile[.in] and GHA for it

Open rucoder opened this issue 3 months ago • 3 comments

Description

We have a lot of Dockerfile files that use outdated syntaf for ENV and VAR assignments. This PR introduces a tool that can be used both as linter and and also can fix all Dockefile's automatically

UPDATE 1: I decided got for tree-sitter based linter

How to test and validate this PR

no need to test from EVE perspective but the package has tests in Python

I also added a dummy Dockerfile to test GH annotations image

image

PR Backports

- 14.5-stable: Up to maintainers 
- 13.4-stable: Up to maintainers 

Checklist

  • [x] I've provided a proper description
  • [x] I've added the proper documentation
  • [ ] I've tested my PR on amd64 device
  • [ ] I've tested my PR on arm64 device
  • [x] I've written the test verification instructions
  • [x] I've set the proper labels to this PR

And the last but not least:

  • [x] I've checked the boxes above, or I've provided a good reason why I didn't check them.

rucoder avatar Sep 05 '25 13:09 rucoder

In principle, I like this idea. We should gave Dockerfiles (and everything else) up to date in syntax.

I have two areas of question.

First, how does this fit with the other GHA CI paths we follow? Should this be part of one of the others? We have a fairly complex structure of CI in GHA, maybe we should check with @yash-zededa ?

Second, this sounds like it fits in line with what yetus does? For all of our complaints about yetus, it does a good job centralizing all of the various linters and checkers into a single place. Should this be part of that? Is there a yetus option or plugin that can do this?

deitch avatar Sep 08 '25 06:09 deitch

@rucoder , it looks like the Linter is proven to work, so you can remove the fake-test commit in order to finalize the review and allow the PR to get merged...

rene avatar Sep 23 '25 10:09 rene

@rucoder , it looks like the Linter is proven to work, so you can remove the fake-test commit in order to finalize the review and allow the PR to get merged...

@rene I'm not sure about one case: ARG MYARG= seems to be a valid syntax, I need to check

rucoder avatar Sep 23 '25 10:09 rucoder