Skip to content

Code quality / linting

Mega-linter

Run mega-linter locally

Global install:

npm install mega-linter-runner -g

Run mega-linter with podman

Usage:

docker run --rm -v $(pwd):/tmp/lint:rw oxsecurity/megalinter:v7

Very few linters require the podman socket (i.e. swiftlint):

systemctl --user start podman.socket
docker run --rm -v /run/user/1000/podman/podman.sock:/var/run/docker.sock:rw \
  -v $(pwd):/tmp/lint:rw oxsecurity/megalinter:v7

Disable linters and checks

Use env vars, i.e.:

Disable linters:

export DISABLE_LINTERS="SPELL_CSPELL,SPELL_LYCHEE,PYTHON_PYRIGHT,PYTHON_MYPY,PYTHON_PYLINT,PYTHON_FLAKE8"

Disable checks:

tba..