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_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 Flavours
This linter is available in the following flavours
Flavor | Description | Embedded linters | Info | |
---|---|---|---|---|
all | Default MegaLinter Flavor | 125 | ||
c_cpp | Optimized for pure C/C++ projects | 56 | ||
ci_light | Optimized for CI items (Dockerfile, Jenkinsfile, JSON/YAML schemas,XML | 21 | ||
cupcake | MegaLinter for the most commonly used languages | 84 | ||
documentation | MegaLinter for documentation projects | 51 | ||
dotnet | Optimized for C, C++, C# or VB based projects | 63 | ||
dotnetweb | Optimized for C, C++, C# or VB based projects with JS/TS | 72 | ||
go | Optimized for GO based projects | 53 | ||
java | Optimized for JAVA based projects | 54 | ||
javascript | Optimized for JAVASCRIPT or TYPESCRIPT based projects | 61 | ||
php | Optimized for PHP based projects | 56 | ||
python | Optimized for PYTHON based projects | 64 | ||
ruby | Optimized for RUBY based projects | 52 | ||
rust | Optimized for RUST based projects | 52 | ||
salesforce | Optimized for Salesforce based projects | 56 | ||
swift | Optimized for SWIFT based projects | 52 | ||
terraform | Optimized for TERRAFORM based projects | 56 |
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):