Skip to content

Mega-Linter Runner

Version Downloads/week Downloads/total GitHub stars

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