Skip to content

Home

Verify your code consistency with an open-source tool.
Powered by OX Security.

GitHub release Docker Pulls Downloads/week GitHub stars GitHub contributors PRs Welcome

MegaLinter is an Open-Source tool for CI/CD workflows that analyzes the consistency of your code, IAC, configuration, and scripts in your repository sources, to ensure all your projects sources are clean and formatted whatever IDE/toolbox is used by their developers, powered by OX security.

Supporting 49 languages, 22 formats, 21 tooling formats and ready to use out of the box, as a GitHub action or any CI system highly configurable and free for all uses.


_**See Article on Medium**_


Process

Archi


Console reporter

Screenshot


Github PR reporter

Screenshot

Why MegaLinter

Projects need to contain clean code, in order to avoid technical debt, that makes evolutive maintenance harder and time consuming.

By using code formatters and code linters, you ensure that your code base is easier to read and respects best practices, from the kick-off to each step of the project lifecycle

Not all developers have the good habit to use linters in their IDEs, making code reviews harder and longer to process

By using MegaLinter, you'll enjoy the following benefits for you and your team:

  • At each pull request it will automatically analyze all updated code in all languages
  • Reading error logs, developers learn best practices of the language they are using
  • MegaLinter documentation provides the list of IDE plugins integrating each linter, so developers know which linter and plugins to install
  • MegaLinter is ready out of the box after a quick setup
  • Formatting and fixes can be automatically applied on the git branch or provided in reports
  • This tool is 100% open-source and free for all uses (personal, professional, public and private repositories)
  • MegaLinter can run on any CI tool and be run locally: no need to authorize an external application, and your code base never leaves your tooling ecosystem

Supported Linters

All linters are integrated in the MegaLinter docker image, which is frequently upgraded with their latest versions

Languages

Language Linter Configuration key Format/Fix Status
BASH bash-exec BASH_EXEC
shellcheck BASH_SHELLCHECK GitHub last commit
shfmt BASH_SHFMT ✔ GitHub last commit
C cpplint C_CPPLINT GitHub last commit
CLOJURE clj-kondo CLOJURE_CLJ_KONDO GitHub last commit
COFFEE coffeelint COFFEE_COFFEELINT GitHub last commit
C++ (CPP) cpplint CPP_CPPLINT GitHub last commit
C# (CSHARP) dotnet-format CSHARP_DOTNET_FORMAT ✔ GitHub last commit
DART dartanalyzer DART_DARTANALYZER GitHub last commit
GO golangci-lint GO_GOLANGCI_LINT GitHub last commit
revive GO_REVIVE GitHub last commit
GROOVY npm-groovy-lint GROOVY_NPM_GROOVY_LINT ✔ GitHub last commit
JAVA checkstyle JAVA_CHECKSTYLE GitHub last commit
JAVASCRIPT eslint JAVASCRIPT_ES ✔ GitHub last commit
standard JAVASCRIPT_STANDARD ✔ GitHub last commit
prettier JAVASCRIPT_PRETTIER ✔ GitHub last commit
JSX eslint JSX_ESLINT ✔ GitHub last commit
KOTLIN ktlint KOTLIN_KTLINT ✔ GitHub last commit
LUA luacheck LUA_LUACHECK GitHub last commit
PERL perlcritic PERL_PERLCRITIC GitHub last commit
PHP php PHP_BUILTIN GitHub last commit
phpcs PHP_PHPCS GitHub last commit
phpstan PHP_PHPSTAN GitHub last commit
psalm PHP_PSALM GitHub last commit
phplint PHP_PHPLINT GitHub last commit
POWERSHELL powershell POWERSHELL_POWERSHELL GitHub last commit
PYTHON pylint PYTHON_PYLINT GitHub last commit
black PYTHON_BLACK ✔ GitHub last commit
flake8 PYTHON_FLAKE8 GitHub last commit
isort PYTHON_ISORT ✔ GitHub last commit
bandit PYTHON_BANDIT GitHub last commit
mypy PYTHON_MYPY GitHub last commit
R lintr R_LINTR
RAKU raku RAKU_RAKU GitHub last commit
RUBY rubocop RUBY_RUBOCOP ✔ GitHub last commit
RUST clippy RUST_CLIPPY GitHub last commit
SALESFORCE sfdx-scanner-apex SALESFORCE_SFDX_SCANNER_APEX GitHub last commit
sfdx-scanner-aura SALESFORCE_SFDX_SCANNER_AURA GitHub last commit
sfdx-scanner-lwc SALESFORCE_SFDX_SCANNER_LWC GitHub last commit
SCALA scalafix SCALA_SCALAFIX GitHub last commit
SQL sql-lint SQL_SQL_LINT GitHub last commit
sqlfluff SQL_SQLFLUFF GitHub last commit
tsqllint SQL_TSQLLINT GitHub last commit
SWIFT swiftlint SWIFT_SWIFTLINT ✔ GitHub last commit
TSX eslint TSX_ESLINT ✔ GitHub last commit
TYPESCRIPT eslint TYPESCRIPT_ES ✔ GitHub last commit
standard TYPESCRIPT_STANDARD ✔ GitHub last commit
prettier TYPESCRIPT_PRETTIER ✔ GitHub last commit
Visual Basic .NET (VBDOTNET) dotnet-format VBDOTNET_DOTNET_FORMAT ✔ GitHub last commit

Formats

Format Linter Configuration key Format/Fix Status
CSS stylelint CSS_STYLELINT ✔ GitHub last commit
scss-lint CSS_SCSS_LINT GitHub last commit
ENV dotenv-linter ENV_DOTENV_LINTER ✔ GitHub last commit
GRAPHQL graphql-schema-linter GRAPHQL_GRAPHQL_SCHEMA_LINTER GitHub last commit
HTML htmlhint HTML_HTMLHINT GitHub last commit
JSON jsonlint JSON_JSONLINT GitHub last commit
eslint-plugin-jsonc JSON_ESLINT_PLUGIN_JSONC ✔ GitHub last commit
v8r JSON_V8R GitHub last commit
prettier JSON_PRETTIER ✔ GitHub last commit
LATEX chktex LATEX_CHKTEX
MARKDOWN markdownlint MARKDOWN_MARKDOWNLINT ✔ GitHub last commit
remark-lint MARKDOWN_REMARK_LINT ✔ GitHub last commit
markdown-link-check MARKDOWN_MARKDOWN_LINK_CHECK GitHub last commit
markdown-table-formatter MARKDOWN_MARKDOWN_TABLE_FORMATTER ✔ GitHub last commit
PROTOBUF protolint PROTOBUF_PROTOLINT ✔ GitHub last commit
RST rst-lint RST_RST_LINT GitHub last commit
rstcheck RST_RSTCHECK GitHub last commit
rstfmt RST_RSTFMT ✔ GitHub last commit
XML xmllint XML_XMLLINT
YAML prettier YAML_PRETTIER ✔ GitHub last commit
yamllint YAML_YAMLLINT GitHub last commit
v8r YAML_V8R GitHub last commit

Tooling formats

Tooling format Linter Configuration key Format/Fix Status
ACTION actionlint ACTION_ACTIONLINT GitHub last commit
ANSIBLE ansible-lint ANSIBLE_ANSIBLE_LINT GitHub last commit
ARM arm-ttk ARM_ARM_TTK GitHub last commit
CLOUDFORMATION cfn-lint CLOUDFORMATION_CFN_LINT GitHub last commit
DOCKERFILE dockerfilelint DOCKERFILE_DOCKERFILELINT GitHub last commit
hadolint DOCKERFILE_HADOLINT GitHub last commit
EDITORCONFIG editorconfig-checker EDITORCONFIG_EDITORCONFIG_CHECKER GitHub last commit
GHERKIN gherkin-lint GHERKIN_GHERKIN_LINT GitHub last commit
KUBERNETES kubeval KUBERNETES_KUBEVAL GitHub last commit
kubeconform KUBERNETES_KUBECONFORM GitHub last commit
OPENAPI spectral OPENAPI_SPECTRAL GitHub last commit
PUPPET puppet-lint PUPPET_PUPPET_LINT ✔ GitHub last commit
SNAKEMAKE snakemake SNAKEMAKE_LINT GitHub last commit
snakefmt SNAKEMAKE_SNAKEFMT ✔ GitHub last commit
TEKTON tekton-lint TEKTON_TEKTON_LINT GitHub last commit
TERRAFORM tflint TERRAFORM_TFLINT GitHub last commit
terrascan TERRAFORM_TERRASCAN GitHub last commit
terragrunt TERRAFORM_TERRAGRUNT ✔ GitHub last commit
terraform-fmt TERRAFORM_TERRAFORM_FMT ✔ GitHub last commit
checkov TERRAFORM_CHECKOV GitHub last commit
kics TERRAFORM_KICS GitHub last commit

Other

Code quality checker Linter Configuration key Format/Fix Status
COPYPASTE jscpd COPYPASTE_JSCPD GitHub last commit
CREDENTIALS secretlint CREDENTIALS_SECRETLINT GitHub last commit
GIT git_diff GIT_GIT_DIFF GitHub last commit
SPELL misspell SPELL_MISSPELL ✔ GitHub last commit
cspell SPELL_CSPELL GitHub last commit

V4 versus V5

  • Tool to upgrade user repos configuration files using npx mega-linter-runner --upgrade (will upgrade references to nvuillam/mega-linter into megalinter/megalinter)
  • Migration from github individual repo nvuillam/mega-linter to github organization repo megalinter/megalinter
  • Migration from docker hub space nvuillam to space megalinter
    • Docker images are now megalinter/megalinter or megalinter/megalinter-FLAVOR
  • Version management: Now mega-linter docker images, github action and mega-linter-runner versions are aligned
    • latest for latest official release
    • beta for current content of main branch
    • alpha for current content of alpha branch
    • docker image, github action and mega-linter-runner can still be called with exact version number
  • Being more inclusive: rename master branch into main
  • IGNORE_GITIGNORED_FILES parameter default to true