luacheck
LuaFormatter
Our great sponsors
luacheck | LuaFormatter | |
---|---|---|
14 | 5 | |
1,864 | 657 | |
- | - | |
0.0 | 0.0 | |
over 1 year ago | 7 months ago | |
Lua | C++ | |
MIT License | Apache License 2.0 |
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.
luacheck
-
strict.lua
Not directly related, but luacheck can also help with this.
-
Help me reload my lua config! :)
Using something like https://github.com/mpeterv/luacheck might be helpful too. Will check all the files in a directory and will let you know which one might be problematic.
-
Lsp: Execute callback after server initialized
I'm trying to setup luacheck (via null-ls) to run alongside sumneko-lua (via nvim-lspconfig).
-
A History of Lua
Most of the time nothing is used. The thing is that iterating is so quick, that you find the problems really fast.
Although, I've been using luacheck https://github.com/mpeterv/luacheck. It is quite nice, but you have to write down the global variables by hand on the config file.
-
Writing a neovim plugin. Please send criticisms to make the code better
Check out luacheck. It can help spot typos or mistakes you've made and warn against anti-patterns. I'd honestly only look into setting it up locally because there's no benefit to putting it in a CI pipeline unless you have one for another reason IMO. This should be all the config you need:
-
Kind of define in lua
You are probably right, but luacheck is well aware of which global variables are built-in and it has special comments, such as -- no global or --ignore in case you very want to overwrite them.
-
Is it ok to name a function for example "function self:Example() end" or is it a big mistake? And how to find (directory) location of a function?
Calling your function self is as much bad practice as calling it print. Use luacheck to avoid such mistakes.
-
Please explain versions of Lua (and the book) to the new user/skeptic
Any Lua program over a few kilobytes should use luacheck; if you want to avoid going crazy it's non-negotiable: https://github.com/mpeterv/luacheck You're right that it's a design mistake, but luacheck makes it relatively easy to work around.
-
Ver 5 will be out soon, and I have a question.Is there any advantage to using init.lua?
advantage: - you can write init.lua using LSP - autoformat https://github.com/Koihik/LuaFormatter - Lint https://github.com/mpeterv/luacheck
LuaFormatter
-
question about plugins
Use and enforce a style with StyLua) or LuaFormatte and neovim can autoformat for ya.
-
StyLua now supports collapsing simple statements
Back in the day when I was making a decision about which formatter to use (I believe, it was between StyLua and LuaFormatter) these observations sealed the deal: - It was already used by many plugins and Neovim itself. - It made handy binary releases which I could download and use right away. - It had easy-to-use github action for Continuous Integration checks.
-
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.
-
Ver 5 will be out soon, and I have a question.Is there any advantage to using init.lua?
advantage: - you can write init.lua using LSP - autoformat https://github.com/Koihik/LuaFormatter - Lint https://github.com/mpeterv/luacheck
What are some alternatives?
StyLua - An opinionated Lua code formatter
lua-language-server - A language server that offers Lua language support - programmed in Lua
luau - A fast, small, safe, gradually typed embeddable scripting language derived from Lua
NvChad - Blazing fast Neovim config providing solid defaults and a beautiful UI, enhancing your neovim experience.
lua-enumerable - A port of ruby's Enumerable module to Lua
NvChad - An attempt to make neovim cli as functional as an IDE while being very beautiful , blazing fast. [Moved to: https://github.com/NvChad/NvChad]
cp.nvim - Competitive programming neovim plugin [Moved to: https://github.com/nullchilly/cpeditor.nvim]
selene - A blazing-fast modern Lua linter written in Rust
cpeditor - The IDE for competitive programming :tada: | Fetch, Code, Compile, Run, Check, Submit :rocket:
telescope.nvim - Find, Filter, Preview, Pick. All lua, all the time.
nvim-oxi - :link: Rust bindings to all things Neovim