eve icon indicating copy to clipboard operation
eve copied to clipboard

Super-Linter

Open europaul opened this issue 1 month ago • 2 comments

Description

This journey started when I tried to fix yetus for the n'th time and couldn't because

  1. I still don't know why it fails (as always)
  2. Our way of using yetus with @rene forking the GH action, creating his own container to add ZFS, using his own docker hub - is not reproducible (not Rene's fault - it was the fastest solution at the time and we didn't evolve from it)
  3. Yetus locally and yetus in CI are two different things (yetus is too smart going out of it's way to figure out if it's being run from a CI)

My proposal - let's try running another linter Super-Linter alongside Yetus for a while and see how we like it. I found this project when I had the please to be fixing Yetus last time, but only assembled a fully working version now. Here are the pros and cons of using Super-Linter vs Yetus:

Pros

  • Super-Linter started as a project run by GitHub and has more contributors and users than Yetus
  • It is still being actively developed with releases coming out multiple times a year
  • It updates the linter version more often
  • It is easier to configure with good documentation and simple configuration through envs
  • We don't need to patch it or release our own version to support ZFS - it has support for runtime dependencies built-in
  • It can be run locally (although it's also not exactly the same behavior as in CI)
  • It's fast - CI run took 2 mins for me vs 10 mins for Yetus
  • It has support for a lot of linters that we use / need - most importantly golangci-lint, hadolint for Dockerfiles, markdown, json and yaml - check out the GH action that I created
  • It also runs zizmor that we now run as standalone check

Cons

  • It doesn't have all the linters that we use in Yetus (e.g. spellcheck, Makefile or revive)
  • Idk if we can run it locally on a diff (like in CI) - worst case we can run it on the changed files like in the case of mini-yetus

The integration of Super-Linter is not finished with this PR. My proposal - let's just try running it alongside Yetus and see if we find it better. I provided here a working GH action can be used out of the box, but we'll still need to tweak it to be more useful for us. If we don't like it or find it useless we can just scrape it at any time.

PR dependencies

None

How to test and validate this PR

If you want to get a picture of how it works check out https://github.com/europaul/eve/pull/3. I put some example code there for the Super-Linter to work on and made it so that the linter finds errors.

It also runs on the current PR, but there is not much to check.

Changelog notes

Add Super-Linter to the CI

PR Backports

No need.

Checklist

  • [x] I've provided a proper description
  • [ ] I've added the proper documentation
  • [x] 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

europaul avatar Nov 11 '25 15:11 europaul

FWIW, these are all the linters our Yetus run during the checks:

BUILDTOOLS:
	nobuild ant autoconf cmake gradle make maven 
TESTTYPES:
	ansiblelint asflicense author blanks buf buflint bufcompat cc checkmake checkstyle codespell detsecrets dupname golangcilint golang hadolint javac javadoc jshint jsonlint markdownlint mvnsite pathlen perlcritic pylint revive rubocop scalac scaladoc shellcheck shelldocs spotbugs test4tests unitveto xmllint yamllint 
BUGSYSTEMS:
	briefreport bugzilla csvout github gitlab htmlout jira junit slack 
TESTFORMATS:
	ctest junit tap 

PS: I've got this list by running: docker run --rm docker.io/lfedge/eve-yetus test-patch --list-plugins

rene avatar Nov 12 '25 12:11 rene

FWIW, these are all the linters our Yetus run during the checks:

BUILDTOOLS:
	nobuild ant autoconf cmake gradle make maven 
TESTTYPES:
	ansiblelint asflicense author blanks buf buflint bufcompat cc checkmake checkstyle codespell detsecrets dupname golangcilint golang hadolint javac javadoc jshint jsonlint markdownlint mvnsite pathlen perlcritic pylint revive rubocop scalac scaladoc shellcheck shelldocs spotbugs test4tests unitveto xmllint yamllint 
BUGSYSTEMS:
	briefreport bugzilla csvout github gitlab htmlout jira junit slack 
TESTFORMATS:
	ctest junit tap 

PS: I've got this list by running: docker run --rm docker.io/lfedge/eve-yetus test-patch --list-plugins

Yeah, I think the important ones missing from Super-Linter are spellchecks and makefile linters. Revive can probably be replaced by golangci-lint. So for now we won't replace yetus with super-linter. Maybe in the future somebody will add those to super-linter or we can run them as standalone.

europaul avatar Nov 12 '25 12:11 europaul