CLI lint mode
Each linter is pre-configured to use a default lint mode, which are visible in the MegaLinter documentation (example). The possible values are:
list_of_files
: The linter is called only once, and passed a list of all the files to be processedproject
: The linter is called only once, from the root folder of the repository, and it scans for the files to process, as no file names are provided itfile
: The linter is called once per file, which hurts performance
You can override the CLI_LINT_MODE by using a configuration variable for each linter (see linters documentation).
- Linters that default to the
file
lint mode cannot be overridden to use thelist_of_files
lint mode - Linters that default to the
project
lint mode cannot be overridden to use either thelist_of_files
orfile
lint modes.
Allowing file
or list_of_files
to be overridden to project
is mostly for workarounds. For example, some linters have a problem finding their config file when the current folder isn't the repository's root folder.
Special considerations:
- Linters that are configured to use the
project
lint mode ignore variables likeFILTER_REGEX_INCLUDE
andFILTER_REGEX_EXCLUDE
, as they are not passed a list of files to lint. For those linters, you must check their documentation to see if a linter can be configured to ignore specific files. For example, the Secretlint linter ignore files listed in~/.secretlintignore
by default, or it can be configured to instead ignore files listed in~/.gitignore
by settingREPOSITORY_SECRETLINT_ARGUMENTS
to--secretlintignore .gitignore.
.