Have ideas to improve npm?Join in the discussion! »

mega-linter-runner

4.26.0 • Public • Published

Mega-Linter Runner

Version Downloads/week Downloads/total GitHub stars

Docker Pulls Mega-Linter codecov PRs Welcome Tweet

Mega-Linter 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 Mega-Linter Online Documentation Web Site

This package allows to run Mega-Linter 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 Mega-Linter locally with Mega-Linter 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 insiders -e 'ENABLE=MARKDOWN,YAML' -e 'SHOW_ELAPSED_TIME=true'

Usage

mega-linter-runner [OPTIONS]

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

Option Description Default
-p
--path
Directory containing the files to lint current directory
--flavor Set this parameter to use a Mega-Linter flavor all
-e
--env
Environment variables for Mega-Linter, following format 'ENV_VAR_NAME=VALUE'
Warning: Quotes are mandatory
--fix Automatically apply formatting and fixes in your files
-r
--release
Allows to override Mega-Linter version used v4
-h
--help
Show mega-linter-runner help
-v
--version
Show mega-linter-runner version
-i
--install
Generate Mega-Linter configuration files

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 insiders -e 'ENABLE=MARKDOWN,YAML' -e 'SHOW_ELAPSED_TIME=true'

Configuration

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

Formats

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

Tooling formats

Tooling format Linter Configuration key Format/Fix
ANSIBLE ansible-lint ANSIBLE_ANSIBLE_LINT
ARM arm-ttk ARM_ARM_TTK
CLOUDFORMATION cfn-lint CLOUDFORMATION_CFN_LINT
DOCKERFILE dockerfilelint DOCKERFILE_DOCKERFILELINT
hadolint DOCKERFILE_HADOLINT
EDITORCONFIG editorconfig-checker EDITORCONFIG_EDITORCONFIG_CHECKER
GHERKIN gherkin-lint GHERKIN_GHERKIN_LINT
KUBERNETES kubeval KUBERNETES_KUBEVAL
OPENAPI spectral OPENAPI_SPECTRAL
PUPPET puppet-lint PUPPET_PUPPET_LINT ✔️
SNAKEMAKE snakemake SNAKEMAKE_LINT
snakefmt SNAKEMAKE_SNAKEFMT ✔️
TEKTON tekton-lint TEKTON_TEKTON_LINT
TERRAFORM tflint TERRAFORM_TFLINT
terrascan TERRAFORM_TERRASCAN
terragrunt TERRAFORM_TERRAGRUNT

Other

Code quality checker Linter Configuration key Format/Fix
COPYPASTE jscpd COPYPASTE_JSCPD
GIT git_diff GIT_GIT_DIFF
SPELL misspell SPELL_MISSPELL ✔️
cspell SPELL_CSPELL

Install

npm i mega-linter-runner

DownloadsWeekly Downloads

753

Version

4.26.0

License

MIT

Unpacked Size

84.4 kB

Total Files

12

Last publish

Collaborators

  • avatar