Mega-linter¶
Run mega-linter locally¶
npx¶
- No installation needed
- Starts
docker run …, and fails with Podman withError: statfs /var/run/docker.sock: permission denied- With Podman you'll need to run the container manually (see below)
$ npx mega-linter-runner --flavor ci_light \
-e "'ENABLE=MARKDOWN,YAML'" -e 'SHOW_ELAPSED_TIME=true'
…
Command: docker run --platform linux/amd64 --rm \
-v /var/run/docker.sock:/var/run/docker.sock:rw \
-v $(pwd):/tmp/lint:rw \
-e ENABLE=MARKDOWN,YAML \
-e SHOW_ELAPSED_TIME=true \
oxsecurity/megalinter-ci_light:v8
Global install¶
Run mega-linter with podman¶
Usage:
Optional to add: --userns=keep-id
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 \
-e ENABLE=YAML \
oxsecurity/megalinter-ci_light:latest
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..
Embedded linters¶
ci_light image¶
checkov¶
Install:
Scan directory:
Suppressing/skipping checks Example:
devskim¶
jscpd¶
- GitHub
- cli docs
- Megalinter docs: jscpd
- Megalinter .jscpd.json
- Config file example (
.jscpd.json):
Local usage:
Issues:
- Megalinter fails when the number of clones is higher than 0, regardless of the configured
threshold
kics¶
- Website
- GitHub
- Megalinter kics config
- AUR package kics-git: Last update 2023-02
Using commands on scanned files as comments:
# kics-scan ignore-block
resource "google_storage_bucket" "example" {
# kics-scan ignore-line
name = "image-store.com"
location = "EU"
force_destroy = true
}