ls-lint
ls-lint documentation
- Version in MegaLinter: 2.2.3
- Visit Official Web Site
- See Index of problems detected by ls-lint
Configuration in MegaLinter
- Enable ls-lint by adding
REPOSITORY_LS_LINT
in ENABLE_LINTERS variable - Disable ls-lint by adding
REPOSITORY_LS_LINT
in DISABLE_LINTERS variable
Variable | Description | Default value |
---|---|---|
REPOSITORY_LS_LINT_ARGUMENTS | User custom arguments to add in linter CLI call Ex: -s --foo "bar" |
|
REPOSITORY_LS_LINT_COMMAND_REMOVE_ARGUMENTS | User custom arguments to remove from command line before calling the linter Ex: -s --foo "bar" |
|
REPOSITORY_LS_LINT_CLI_LINT_MODE | Override default CLI lint mode ⚠️ As default value is project, overriding might not work - file : Calls the linter for each file- list_of_files : Call the linter with the list of files as argument- project : Call the linter from the root of the project |
project |
REPOSITORY_LS_LINT_PRE_COMMANDS | List of bash commands to run before the linter | None |
REPOSITORY_LS_LINT_POST_COMMANDS | List of bash commands to run after the linter | None |
REPOSITORY_LS_LINT_UNSECURED_ENV_VARIABLES | List of env variables explicitly not filtered before calling REPOSITORY_LS_LINT and its pre/post commands | None |
REPOSITORY_LS_LINT_CONFIG_FILE | ls-lint configuration file nameUse LINTER_DEFAULT to let the linter find it |
.ls-lint.yml |
REPOSITORY_LS_LINT_RULES_PATH | Path where to find linter configuration file | Workspace folder, then MegaLinter default rules |
REPOSITORY_LS_LINT_DISABLE_ERRORS | Run linter but consider errors as warnings | false |
REPOSITORY_LS_LINT_DISABLE_ERRORS_IF_LESS_THAN | Maximum number of errors allowed | 0 |
REPOSITORY_LS_LINT_CLI_EXECUTABLE | Override CLI executable | ['ls-lint'] |
MegaLinter Flavors
This linter is available in the following flavors
Flavor | Description | Embedded linters | Info | |
---|---|---|---|---|
![]() |
all | Default MegaLinter Flavor | 122 | |
c_cpp | Optimized for pure C/C++ projects | 54 | ||
ci_light | Optimized for CI items (Dockerfile, Jenkinsfile, JSON/YAML schemas,XML | 21 | ||
cupcake | MegaLinter for the most commonly used languages | 83 | ||
documentation | MegaLinter for documentation projects | 49 | ||
dotnet | Optimized for C, C++, C# or VB based projects | 61 | ||
dotnetweb | Optimized for C, C++, C# or VB based projects with JS/TS | 70 | ||
go | Optimized for GO based projects | 51 | ||
java | Optimized for JAVA based projects | 52 | ||
javascript | Optimized for JAVASCRIPT or TYPESCRIPT based projects | 59 | ||
php | Optimized for PHP based projects | 54 | ||
python | Optimized for PYTHON based projects | 62 | ||
ruby | Optimized for RUBY based projects | 50 | ||
rust | Optimized for RUST based projects | 50 | ||
salesforce | Optimized for Salesforce based projects | 54 | ||
swift | Optimized for SWIFT based projects | 50 | ||
terraform | Optimized for TERRAFORM based projects | 54 |
Behind the scenes
How are identified applicable files
- Activated only if one of these files is found:
.ls-lint.yml
- If this linter is active, all files will always be linted
How the linting is performed
ls-lint is called once on the whole project directory (project
CLI lint mode)
- filtering can not be done using MegaLinter configuration variables,it must be done using ls-lint configuration or ignore file (if existing)
VALIDATE_ALL_CODEBASE: false
doesn't make ls-lint analyze only updated files
Example calls
ls-lint
ls-lint --workdir src
Help content
Usage of /node-deps/node_modules/@ls-lint/ls-lint/bin/ls-lint-linux-amd64:
-config value
ls-lint config file path(s)
-debug
write debug informations to stdout
-version
prints version information for ls-lint
-warn
write lint errors to stdout instead of stderr (exit 0)
-workdir string
change working directory before executing the given subcommand (default ".")
Installation on mega-linter Docker image
- NPM packages (node.js):