← 返回命令列表

Linux command

selene 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Lint Lua files

selene .

Lint specific files

selene [path/to/file1.lua] [path/to/file2.lua]

Lint with a custom configuration file

selene --config [path/to/selene.toml] [path/to/files]

Lint and suppress summary

selene --no-summary [path/to/files]

Lint with quiet output

selene --quiet [path/to/files]

Lint with JSON output

selene --display-style json [path/to/files]

Validate configuration file

selene validate-config

说明

selene is a fast, modern Lua linter written in Rust. It analyzes Lua code to detect bugs, style issues, and potential problems before runtime. The tool supports standard Lua as well as Luau (Roblox's Lua dialect) through configurable standard libraries. Configuration is done via a selene.toml file where you can enable or disable specific lints, set their severity levels, and configure standard library definitions. The linter integrates well with editors and CI/CD pipelines through its JSON output modes. selene is particularly popular in the Roblox development community but works for any Lua project. It can be extended with custom lint rules and standard library definitions.

参数

--allow-warnings
Exit successfully when only warnings (no errors) occur.
--color _color_
Control color output. Possible values: Always, Auto, Never. Default: Auto.
--config _config_
Path to a TOML configuration file. Default: selene.toml in current directory.
--display-style _style_
Set the output display format. Possible values: Json, Json2, Rich, Quiet.
--num-threads _n_
Number of threads to use. Defaults to the number of logical CPU cores.
--pattern _pattern_
A glob pattern to match files to check. Can be specified multiple times.
--no-exclude
Do not respect exclude patterns from configuration.
-n, --no-summary
Suppress the summary information at the end of linting.
-q, --quiet
Display only essential information. Equivalent to --display-style=quiet.
-h, --help
Print help information.
-V, --version
Print version information.

FAQ

What is the selene command used for?

selene is a fast, modern Lua linter written in Rust. It analyzes Lua code to detect bugs, style issues, and potential problems before runtime. The tool supports standard Lua as well as Luau (Roblox's Lua dialect) through configurable standard libraries. Configuration is done via a selene.toml file where you can enable or disable specific lints, set their severity levels, and configure standard library definitions. The linter integrates well with editors and CI/CD pipelines through its JSON output modes. selene is particularly popular in the Roblox development community but works for any Lua project. It can be extended with custom lint rules and standard library definitions.

How do I run a basic selene example?

Run `selene .` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --allow-warnings do in selene?

Exit successfully when only warnings (no errors) occur.