-
Hi! I've been working on improving the Bevy Engine's website CI. We use megalinter only for DJLint, Markdownlint, and Editorconfig Checker. It seems a bit silly to pull in a 3.5 GB image for only three linters, which takes about 2.5 minutes in CI. How would I create my own flavor that only contained the above linters? I'd most likely fork this repo, but where would I go from there? I looked over the contributing page on the website, but could not find any resources on this. (Also the amount of files in the repo is intimidating 😅) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Well, it depends on what your strengths are. There's a hard way, where you would manipulate docker images, since individual linters are published as images, so it would be possible to combine them by copying files around, and adjusting the env vars that are set at the end of the dockerfile. Editorconfig-checker is an easy one, since it is a single file copied from a docker image. That's if you are more comfortable in docker. Another way would be to run megalinter three individual linters back to back. Finally, the more durable way, but needs to be maintained like a downstream fork, is adding a flavor here: megalinter/megalinter/flavor_factory.py Lines 41 to 68 in 3efbff3 then adding that flavor name in Then each time, just run ./build.sh and all the generated files get synced from these descriptors (including the dockerfiles). You could now build the images from the dockerfile of your flavor. Note that you'll probably have a hard time updating from upstream at each update with a lot of conflicts, but only the 3 added lines for your three linters and the added line in the descriptor would need to be kept, the rest would be generated back. |
Beta Was this translation helpful? Give feedback.
Well, it depends on what your strengths are. There's a hard way, where you would manipulate docker images, since individual linters are published as images, so it would be possible to combine them by copying files around, and adjusting the env vars that are set at the end of the dockerfile. Editorconfig-checker is an easy one, since it is a single file copied from a docker image. That's if you are more comfortable in docker.
Another way would be to run megalinter three individual linters back to back.
If you are confortable in docker, in another way, it could be technically possible to repack the megalinter images with eStargz compression/indexing, that would allow if using containerd sto…