oxsecurity / megalinter

🦙 MegaLinter analyzes 50 languages, 22 formats, 21 tooling formats, excessive copy-pastes, spelling mistakes and security issues in your repository sources with a GitHub Action, other CI tools or locally.
https://megalinter.io
GNU Affero General Public License v3.0
1.96k stars 238 forks source link

Add new flavor definition style, add bioinformatics flavor #4257

Open nwiltsie opened 1 week ago

nwiltsie commented 1 week ago

This is a somewhat provocative PR that does two things - no hard feelings if you reject either or both changes.

Proposed Changes

  1. Add logic to respect descriptors and linters entries in flavor info returned from megalinter.flavor_factory.list_megalinter_flavors()
    • It feels very non-DRY to have each descriptor list all the flavors that include it, rather than having each flavor list the descriptors it includes.
    • I've added logic so that the flavor information dicts returned from list_megalinter_flavors() can include pre-filled descriptors and linters lists. That seems to allow a flavor to be completely defined within flavor_factory.py.
  2. Add a new bioinformatics flavor.

Based on local testing this seems to work as expected - the bioinformatics Dockerfile builds and runs appropriately, and bioinformatics appears as a new flavor (including being linked from each "This linter is available in the following flavors" section).

From the outside this seems like a cleaner way to define flavors, but I easily could be missing some critical reason why the current method is necessary.

Readiness Checklist

Author/Contributor

Reviewing Maintainer