Activation and deactivation
MegaLinter has all linters enabled by default, but allows enabling or disabling specific ones.
- If
ENABLEisn't set, all descriptors are activated by default. If set, all linters of listed descriptors are activated by default. - If
ENABLE_LINTERSis set, only the listed linters are processed. - If
DISABLEis set, the linters in the listed descriptors are skipped. - If
DISABLE_LINTERSis set, the listed linters are skipped. - If a linter is in both
ENABLE_LINTERSandDISABLE_LINTERS,ENABLE_LINTERSwins by default. SetENABLE_DISABLE_LINTERS_PRIORITY: DISABLEto makeDISABLE_LINTERSoverrideENABLE_LINTERSinstead (useful to trim an inheritedENABLE_LINTERSlist when usingEXTENDS). - If
DISABLE_ERRORS_LINTERSis set, the listed linters will run, but if errors are found, they will be considered non-blocking. - If
ENABLE_ERRORS_LINTERSis set, only the linters in this list will be considered blocking.
Examples:
- Run all javascript and groovy linters except STANDARD javascript linter. DevSkim errors will be non-blocking
ENABLE: JAVASCRIPT,GROOVY
DISABLE_LINTERS: JAVASCRIPT_STANDARD
DISABLE_ERRORS_LINTERS: REPOSITORY_DEVSKIM
- Run all matching linters but only trivy is blocking
ENABLE_ERRORS_LINTERS: REPOSITORY_TRIVY
- Run all linters except PHP linters (PHP_BUILTIN, PHP_PHPCS, PHP_PHPSTAN, PHP_PSALM)
DISABLE: PHP
- Run all linters except PHP_PHPSTAN and PHP_PSALM linters
DISABLE_LINTERS:
- PHP_PHPSTAN
- PHP_PSALM
- Inherit a shared
ENABLE_LINTERSlist viaEXTENDSbut skip one of the inherited linters locally
EXTENDS: https://example.com/shared/.mega-linter.yml
ENABLE_DISABLE_LINTERS_PRIORITY: DISABLE
DISABLE_LINTERS:
- PYTHON_PYLINT