mega-linter-runner

7.9.0 • Public • Published

MegaLinter Runner

Version Downloads/week Downloads/total GitHub stars

Docker Pulls MegaLinter codecov Secured with Trivy GitHub Sponsors PRs Welcome Tweet

MegaLinter analyzes 37 languages, 15 formats, 16 tooling formats , copy-pastes and spell in your repository sources, generate reports in several formats, and can even apply formatting and auto-fixes with auto-generated commit or PR, to ensure all your projects are clean, whatever IDE/toolbox are used by their developers !

See MegaLinter Online Documentation Web Site

This package allows to run MegaLinter locally before running it in your CD/CI workflow, or simply to locally apply reformatting and fixes without having to install up to date linters for your files

Screenshot

Installation

Pre-requisites

You need to have NodeJS and Docker installed on your computer to run MegaLinter locally with MegaLinter Runner

Global installation

npm install mega-linter-runner -g

Local installation

npm install mega-linter-runner --save-dev

No installation

You can run mega-linter-runner without installation by using npx

Example:

npx mega-linter-runner -r beta -e "'ENABLE=MARKDOWN,YAML'" -e 'SHOW_ELAPSED_TIME=true'

Pre-commit hook

You can run mega-linter-runner as a pre-commit hook

Sample .pre-commit-config.yaml:

repos:
  - repo: https://github.com/oxsecurity/megalinter
    rev: v6.8.0 # Git tag specifying the hook, not mega-linter-runner, version
    hooks:
      - id: megalinter-incremental # Faster, less thorough
        stages:
          - commit
      - id: megalinter-full # Slower, more thorough
        stages:
          - push

See .pre-commit-hooks.yaml for more details.

Usage

mega-linter-runner [OPTIONS] [FILES]

The options are only related to mega-linter-runner. For MegaLinter options, please use a .mega-linter.yml configuration file

Option Description Default
-p
--path
Directory containing the files to lint current directory
-f
--flavor
Set this parameter to use a MegaLinter flavor all
-d
--image
You can override the used docker image, including if it's on another docker registry
-e
--env
Environment variables for MegaLinter, following format 'ENV_VAR_NAME=VALUE' for a single value or "'ENV_VAR_NAME=VALUE1,VALUE2'" for a list of values
Warning: Quotes are mandatory
--fix Automatically apply formatting and fixes in your files
-r
--release
Allows to override MegaLinter version used v5
-h
--help
Show mega-linter-runner help
-v
--version
Show mega-linter-runner version
-i
--install
Generate MegaLinter configuration files
--container-name Specify MegaLinter container name
--remove-container Remove MegaLinter Docker container when done

You can also use npx mega-linter-runner if you do not want to install the package

Examples

mega-linter-runner
mega-linter-runner -p myFolder --fix
mega-linter-runner -r beta -e "'ENABLE=MARKDOWN,YAML'" -e 'SHOW_ELAPSED_TIME=true'
mega-linter-runner --flavor python --release beta --filesonly path/to/my/file1.py another/path/to/a/file.js and/another/file.py

Configuration

You can generate a ready-to-use .mega-linter.yml configuration file by running npx mega-linter-runner --install at the root of your repository

Runner Install

Linters

Languages

Language Linter Additional
BASH bash-exec
BASH_EXEC
BASH shellcheck
BASH_SHELLCHECK
GitHub stars sarif
BASH shfmt
BASH_SHFMT
GitHub stars formatter
C cpplint
C_CPPLINT
GitHub stars
C clang-format
C_CLANG_FORMAT
GitHub stars autofix
CLOJURE clj-kondo
CLOJURE_CLJ_KONDO
GitHub stars
CLOJURE cljstyle
CLOJURE_CLJSTYLE
GitHub stars autofix
COFFEE coffeelint
COFFEE_COFFEELINT
GitHub stars
C++ (CPP) cpplint
CPP_CPPLINT
GitHub stars
C++ (CPP) clang-format
CPP_CLANG_FORMAT
GitHub stars autofix
C# (CSHARP) dotnet-format
CSHARP_DOTNET_FORMAT
GitHub stars formatter
C# (CSHARP) csharpier
CSHARP_CSHARPIER
GitHub stars formatter
C# (CSHARP) roslynator
CSHARP_ROSLYNATOR
GitHub stars formatter
DART dartanalyzer
DART_DARTANALYZER
downgraded version GitHub stars
GO golangci-lint
GO_GOLANGCI_LINT
GitHub stars autofix
GO revive
GO_REVIVE
GitHub stars sarif
GROOVY npm-groovy-lint
GROOVY_NPM_GROOVY_LINT
GitHub stars autofix sarif
JAVA checkstyle
JAVA_CHECKSTYLE
GitHub stars sarif
JAVA pmd
JAVA_PMD
GitHub stars sarif
JAVASCRIPT eslint
JAVASCRIPT_ES
GitHub stars autofix sarif
JAVASCRIPT standard
JAVASCRIPT_STANDARD
GitHub stars autofix
JAVASCRIPT prettier
JAVASCRIPT_PRETTIER
GitHub stars formatter
JSX eslint
JSX_ESLINT
GitHub stars autofix sarif
KOTLIN ktlint
KOTLIN_KTLINT
GitHub stars autofix sarif
LUA luacheck
LUA_LUACHECK
GitHub stars
MAKEFILE checkmake
MAKEFILE_CHECKMAKE
GitHub stars
PERL perlcritic
PERL_PERLCRITIC
GitHub stars
PHP phpcs
PHP_PHPCS
GitHub stars
PHP phpstan
PHP_PHPSTAN
GitHub stars
PHP psalm
PHP_PSALM
GitHub stars sarif
PHP phplint
PHP_PHPLINT
GitHub stars
POWERSHELL powershell
POWERSHELL_POWERSHELL
GitHub stars autofix
POWERSHELL powershell_formatter
POWERSHELL_POWERSHELL_FORMATTER
GitHub stars formatter
PYTHON pylint
PYTHON_PYLINT
GitHub stars
PYTHON black
PYTHON_BLACK
GitHub stars formatter
PYTHON flake8
PYTHON_FLAKE8
GitHub stars
PYTHON isort
PYTHON_ISORT
GitHub stars formatter
PYTHON bandit
PYTHON_BANDIT
GitHub stars sarif
PYTHON mypy
PYTHON_MYPY
GitHub stars
PYTHON pyright
PYTHON_PYRIGHT
GitHub stars
PYTHON ruff
PYTHON_RUFF
GitHub stars autofix
R lintr
R_LINTR
GitHub stars
RAKU raku
RAKU_RAKU
GitHub stars
RUBY rubocop
RUBY_RUBOCOP
GitHub stars autofix
RUST clippy
RUST_CLIPPY
GitHub stars
SALESFORCE sfdx-scanner-apex
SALESFORCE_SFDX_SCANNER_APEX
GitHub stars
SALESFORCE sfdx-scanner-aura
SALESFORCE_SFDX_SCANNER_AURA
GitHub stars
SALESFORCE sfdx-scanner-lwc
SALESFORCE_SFDX_SCANNER_LWC
GitHub stars
SALESFORCE lightning-flow-scanner
SALESFORCE_LIGHTNING_FLOW_SCANNER
GitHub stars
SCALA scalafix
SCALA_SCALAFIX
GitHub stars
SQL sql-lint
SQL_SQL_LINT
GitHub stars
SQL sqlfluff
SQL_SQLFLUFF
GitHub stars
SQL tsqllint
SQL_TSQLLINT
GitHub stars
SWIFT swiftlint
SWIFT_SWIFTLINT
GitHub stars autofix
TSX eslint
TSX_ESLINT
GitHub stars autofix sarif
TYPESCRIPT eslint
TYPESCRIPT_ES
GitHub stars autofix sarif
TYPESCRIPT ts-standard
TYPESCRIPT_STANDARD
GitHub stars autofix
TYPESCRIPT prettier
TYPESCRIPT_PRETTIER
GitHub stars formatter
Visual Basic .NET (VBDOTNET) dotnet-format
VBDOTNET_DOTNET_FORMAT
GitHub stars formatter

Formats

Format Linter Additional
CSS stylelint
CSS_STYLELINT
GitHub stars autofix
CSS scss-lint
CSS_SCSS_LINT
deprecated GitHub stars
ENV dotenv-linter
ENV_DOTENV_LINTER
GitHub stars autofix
GRAPHQL graphql-schema-linter
GRAPHQL_GRAPHQL_SCHEMA_LINTER
GitHub stars
HTML djlint
HTML_DJLINT
GitHub stars
HTML htmlhint
HTML_HTMLHINT
GitHub stars
JSON jsonlint
JSON_JSONLINT
GitHub stars
JSON eslint-plugin-jsonc
JSON_ESLINT_PLUGIN_JSONC
GitHub stars autofix sarif
JSON v8r
JSON_V8R
GitHub stars
JSON prettier
JSON_PRETTIER
GitHub stars formatter
JSON npm-package-json-lint
JSON_NPM_PACKAGE_JSON_LINT
GitHub stars
LATEX chktex
LATEX_CHKTEX
MARKDOWN markdownlint
MARKDOWN_MARKDOWNLINT
GitHub stars formatter
MARKDOWN remark-lint
MARKDOWN_REMARK_LINT
GitHub stars formatter
MARKDOWN markdown-link-check
MARKDOWN_MARKDOWN_LINK_CHECK
GitHub stars
MARKDOWN markdown-table-formatter
MARKDOWN_MARKDOWN_TABLE_FORMATTER
GitHub stars formatter
PROTOBUF protolint
PROTOBUF_PROTOLINT
GitHub stars autofix
RST rst-lint
RST_RST_LINT
GitHub stars
RST rstcheck
RST_RSTCHECK
GitHub stars
RST rstfmt
RST_RSTFMT
formatter
XML xmllint
XML_XMLLINT
autofix
YAML prettier
YAML_PRETTIER
GitHub stars formatter
YAML yamllint
YAML_YAMLLINT
GitHub stars
YAML v8r
YAML_V8R
GitHub stars

Tooling formats

Tooling format Linter Additional
ACTION actionlint
ACTION_ACTIONLINT
GitHub stars
ANSIBLE ansible-lint
ANSIBLE_ANSIBLE_LINT
GitHub stars sarif
ARM arm-ttk
ARM_ARM_TTK
GitHub stars
BICEP bicep_linter
BICEP_BICEP_LINTER
GitHub stars
CLOUDFORMATION cfn-lint
CLOUDFORMATION_CFN_LINT
GitHub stars sarif
DOCKERFILE hadolint
DOCKERFILE_HADOLINT
GitHub stars sarif
EDITORCONFIG editorconfig-checker
EDITORCONFIG_EDITORCONFIG_CHECKER
GitHub stars
GHERKIN gherkin-lint
GHERKIN_GHERKIN_LINT
GitHub stars
KUBERNETES kubeconform
KUBERNETES_KUBECONFORM
GitHub stars
KUBERNETES helm
KUBERNETES_HELM
GitHub stars
KUBERNETES kubescape
KUBERNETES_KUBESCAPE
downgraded version GitHub stars sarif
OPENAPI spectral
OPENAPI_SPECTRAL
GitHub stars
PUPPET puppet-lint
PUPPET_PUPPET_LINT
GitHub stars autofix
SNAKEMAKE snakemake
SNAKEMAKE_LINT
GitHub stars
SNAKEMAKE snakefmt
SNAKEMAKE_SNAKEFMT
GitHub stars formatter
TEKTON tekton-lint
TEKTON_TEKTON_LINT
GitHub stars
TERRAFORM tflint
TERRAFORM_TFLINT
GitHub stars sarif
TERRAFORM terrascan
TERRAFORM_TERRASCAN
GitHub stars sarif
TERRAFORM terragrunt
TERRAFORM_TERRAGRUNT
GitHub stars autofix
TERRAFORM terraform-fmt
TERRAFORM_TERRAFORM_FMT
GitHub stars formatter

Other

Code quality checker Linter Additional
COPYPASTE jscpd
COPYPASTE_JSCPD
GitHub stars
REPOSITORY checkov
REPOSITORY_CHECKOV
GitHub stars sarif
REPOSITORY devskim
REPOSITORY_DEVSKIM
GitHub stars sarif
REPOSITORY dustilock
REPOSITORY_DUSTILOCK
GitHub stars sarif
REPOSITORY git_diff
REPOSITORY_GIT_DIFF
GitHub stars
REPOSITORY gitleaks
REPOSITORY_GITLEAKS
GitHub stars sarif
REPOSITORY grype
REPOSITORY_GRYPE
GitHub stars sarif
REPOSITORY kics
REPOSITORY_KICS
GitHub stars sarif
REPOSITORY secretlint
REPOSITORY_SECRETLINT
GitHub stars sarif
REPOSITORY semgrep
REPOSITORY_SEMGREP
GitHub stars sarif
REPOSITORY syft
REPOSITORY_SYFT
GitHub stars sarif
REPOSITORY trivy
REPOSITORY_TRIVY
GitHub stars sarif
REPOSITORY trivy-sbom
REPOSITORY_TRIVY_SBOM
GitHub stars sarif
REPOSITORY trufflehog
REPOSITORY_TRUFFLEHOG
GitHub stars
SPELL cspell
SPELL_CSPELL
GitHub stars
SPELL proselint
SPELL_PROSELINT
GitHub stars
SPELL vale
SPELL_VALE
GitHub stars
SPELL lychee
SPELL_LYCHEE
GitHub stars

Package Sidebar

Install

npm i mega-linter-runner

Weekly Downloads

3,543

Version

7.9.0

License

MIT

Unpacked Size

176 kB

Total Files

18

Last publish

Collaborators

  • nvuillam
  • megalinter