Skip to content

selene

GitHub stars GitHub release (latest SemVer) GitHub last commit GitHub commit activity GitHub contributors

selene documentation

selene - GitHub

Configuration in MegaLinter

Variable Description Default value
LUA_SELENE_ARGUMENTS User custom arguments to add in linter CLI call
Ex: -s --foo "bar"
LUA_SELENE_COMMAND_REMOVE_ARGUMENTS User custom arguments to remove from command line before calling the linter
Ex: -s --foo "bar"
LUA_SELENE_FILTER_REGEX_INCLUDE Custom regex including filter
Ex: (src\|lib)
Include every file
LUA_SELENE_FILTER_REGEX_EXCLUDE Custom regex excluding filter
Ex: (test\|examples)
Exclude no file
LUA_SELENE_CLI_LINT_MODE Override default CLI lint mode
- file: Calls the linter for each file
- project: Call the linter from the root of the project
file
LUA_SELENE_FILE_EXTENSIONS Allowed file extensions. "*" matches any extension, "" matches empty extension. Empty list excludes all files
Ex: [".py", ""]
[".lua"]
LUA_SELENE_FILE_NAMES_REGEX File name regex filters. Regular expression list for filtering files by their base names using regex full match. Empty list includes all files
Ex: ["Dockerfile(-.+)?", "Jenkinsfile"]
Include every file
LUA_SELENE_PRE_COMMANDS List of bash commands to run before the linter None
LUA_SELENE_POST_COMMANDS List of bash commands to run after the linter None
LUA_SELENE_UNSECURED_ENV_VARIABLES List of env variables explicitly not filtered before calling LUA_SELENE and its pre/post commands None
LUA_SELENE_CONFIG_FILE selene configuration file nameUse LINTER_DEFAULT to let the linter find it selene.toml
LUA_SELENE_RULES_PATH Path where to find linter configuration file Workspace folder, then MegaLinter default rules
LUA_SELENE_DISABLE_ERRORS Run linter but consider errors as warnings false
LUA_SELENE_DISABLE_ERRORS_IF_LESS_THAN Maximum number of errors allowed 0
LUA_SELENE_CLI_EXECUTABLE Override CLI executable ['selene']

IDE Integration

Use selene in your favorite IDE to catch errors before MegaLinter !

IDE Extension Name Install
neovim ['nvim-lint', 'none-ls'] Visit Web Site
Sublime Text SublimeLinter-contrib-selene Visit Web Site
Visual Studio Code selene-vscode Install in VSCode

MegaLinter Flavors

This linter is available in the following flavors

Flavor Description Embedded linters Info
all Default MegaLinter Flavor 124 Docker Image Size (tag) Docker Pulls

Behind the scenes

How are identified applicable files

  • File extensions: .lua

How the linting is performed

  • selene is called one time by identified file (file CLI lint mode)

Example calls

selene myfile.lua
selene --config chktexrc.toml myfile.lua

Help content

selene 0.27.1

USAGE:
    selene [FLAGS] [OPTIONS] <files>...
    selene <SUBCOMMAND>

FLAGS:
        --allow-warnings    Pass when only warnings occur
    -h, --help              Prints help information
        --no-exclude
    -n, --no-summary        Suppress summary information
    -q, --quiet             Display only the necessary information. Equivalent to --display-style="quiet"
    -V, --version           Prints version information

OPTIONS:
        --color <color>                     [default: auto]  [possible values: Always, Auto, Never]
        --config <config>                  A toml file to configure the behavior of selene [default: selene.toml]
        --display-style <display-style>    Sets the display method [possible values: Json, Json2, Rich, Quiet]
        --num-threads <num-threads>        Number of threads to run on, default to the numbers of logical cores on your
                                           system [default: 4]
        --pattern <pattern>...             A glob to match files with to check

ARGS:
    <files>...

SUBCOMMANDS:
    capabilities           Prints the capabilities of the current build
    generate-roblox-std
    help                   Prints this message or the help of the given subcommand(s)
    update-roblox-std
    upgrade-std
    validate-config

Installation on mega-linter Docker image

  • Dockerfile commands :
# Parent descriptor install
RUN wget --tries=5 https://www.lua.org/ftp/lua-5.3.5.tar.gz -O - -q | tar -xzf - \
    && cd lua-5.3.5 \
    && make linux \
    && make install \
    && cd .. && rm -r lua-5.3.5/

# Linter install
# renovate: datasource=crate depName=selene
ARG LUA_SELENE_VERSION=0.27.1