mirror of
https://github.com/nix-community/home-manager.git
synced 2026-10-02 19:49:18 +00:00
Stylua is deterministic formatter for Lua 5.1, 5.2, 5.3, 5.4, LuaJIT, Luau and CfxLua/FiveM Lua, built using full-moon. StyLua is inspired by the likes of prettier, it parses your Lua codebase, and prints it back out from scratch, enforcing a consistent code style.
21 lines
574 B
Nix
21 lines
574 B
Nix
{ realPkgs, ... }: {
|
|
programs.stylua = {
|
|
enable = true;
|
|
settings = {
|
|
call_parentheses = "Always";
|
|
collapse_simple_statement = "Always";
|
|
column_width = 85;
|
|
indent_type = "Spaces";
|
|
indent_width = 2;
|
|
line_endings = "Unix";
|
|
quote_style = "AutoPreferSingle";
|
|
};
|
|
};
|
|
test.unstubs = [ (_self: _super: { inherit (realPkgs) stylua; }) ];
|
|
|
|
nmt.script = ''
|
|
assertFileContent "home-files/.config/stylua/stylua.toml" ${./expected-config.toml}
|
|
assertFileRegex "home-path/bin/stylua" "search-parent-directories"
|
|
'';
|
|
}
|