StyLua
An opinionated Lua code formatter (by JohnnyMorganz)
selene
A blazing-fast modern Lua linter written in Rust (by Kampfkarren)
StyLua | selene | |
---|---|---|
11 | 5 | |
1,384 | 535 | |
- | - | |
8.6 | 7.0 | |
about 1 month ago | 7 days ago | |
Rust | Rust | |
Mozilla Public License 2.0 | Mozilla Public License 2.0 |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
StyLua
Posts with mentions or reviews of StyLua.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-10-04.
-
question about plugins
Use and enforce a style with StyLua) or LuaFormatte and neovim can autoformat for ya.
-
sumneko_lua not respecting project's stylua.toml
stylua.toml is the config file of Stylua not of sumneko-lua
-
StyLua now supports collapsing simple statements
Starting from version 0.14.0, StyLua (the Lua code formatter in Neovim world) implements option collapse_simple_statement. From release notes:
-
Writing a neovim plugin. Please send criticisms to make the code better
Check out StyLua if you want a code formatter.
-
luaCheck and class definition
Here is the instruction how to install and config.
-
Cannot run executables with Alpine and Busybox images
RUN wget -O stylua-0.11.0-linux.zip https://github.com/JohnnyMorganz/StyLua/releases/download/v0.11.0/stylua-0.11.0-linux.zip && \ unzip stylua-0.11.0-linux.zip && \ rm stylua-0.11.0-linux.zip && \ chmod +x stylua
-
Difference between require("foo") and require"foo"
If your function call has only one argument and it happens to be a literal string or a table, then you might want to eliminate the parenthesis. Use whatever style you prefer, the later is useful for some DSLs. Let stylua auto format it anyway.
-
Lua Indentation Woes
Have you tried any external programs to format your code instead? That's what I usually do. Just set 'formatprg', and use gq to format the code. With a quick search I found LuaFormatter, and StyLua, but I can't say if they format the code the way you want. In my experience, external code formaters will do a better job, and they have more options to tweak as well.
-
[question] Where can i find the formatter tool for lua ?
Have a look at https://github.com/JohnnyMorganz/StyLua together with https://github.com/jose-elias-alvarez/null-ls.nvim
-
lua-format : how to keep equals signs aligned (like EasyAlign)
I personally use https://github.com/JohnnyMorganz/StyLua and I am seeing it a lot in some popular projects like telescope.nvim, nvim-lspconfig and ther is also a PR to include it into neovim itself to format the lua files.
selene
Posts with mentions or reviews of selene.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-08-10.
-
Configuring global variables(vim) in selene
Here's an issue about it: https://github.com/Kampfkarren/selene/issues/284
-
Cannot run executables with Alpine and Busybox images
RUN wget -O selene-light-0.14.0-linux.zip https://github.com/Kampfkarren/selene/releases/download/0.14.0/selene-light-0.14.0-linux.zip && \ unzip selene-light-0.14.0-linux.zip && \ rm selene-light-0.14.0-linux.zip && \ chmod +x selene
-
Yes that's what `if_chain!` actually expands to
Traversing an AST. An example from Selene - /src/rules/divide_by_zero.rs#L64-L70.
-
Rojo Yellow Underlines
Pretty sure this is it, but it's been a while since Ive had to set this all up https://github.com/Kampfkarren/selene
What are some alternatives?
When comparing StyLua and selene you can also consider the following projects:
null-ls.nvim - Use Neovim as a language server to inject LSP diagnostics, code actions, and more via Lua.
vscode-lua-format - Reformats your Lua source code
LuaFormatter - Code formatter for Lua
luacheck - A tool for linting and static analysis of Lua code.
static-curl - fully static builds of curl, runs anywhere
tauri - Build smaller, faster, and more secure desktop applications with a web frontend.
lua-style-guide - Lua Style Guide, as used by LuaRocks
twilight.nvim - 🌅 Twilight is a Lua plugin for Neovim 0.5 that dims inactive portions of the code you're editing using TreeSitter.
lua-json5 - A json5 parser for luajit
MeiliSearch - A lightning-fast search API that fits effortlessly into your apps, websites, and workflow