Problem:
Not all Lua code is checked by stylua. Automating code-style is an
important mechanism for reducing time spent on accidental
(non-essential) complexity.
Solution:
- Enable stylua for entire `test/` directory.
- Exclude these high-churn files until this issue is resolved: https://github.com/JohnnyMorganz/StyLua/issues/829
```
test/functional/ui/decorations_spec.lua | 3560 ++++++++++++++++++++++++++++++++++++----------------
test/functional/ui/float_spec.lua | 5826 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------
test/functional/ui/multigrid_spec.lua | 1349 ++++++++++++++------
```
- Make surgical changes to these files (or add `stylua: ignore` in some
small scopes) to improve the result:
```
test/functional/vimscript/msgpack_functions_spec.lua | 1414 +++++++++++++++------
test/functional/api/buffer_spec.lua | 1389 +++++++++++----------
test/functional/api/vim_spec.lua | 2740 +++++++++++++++++++++++-----------------
```
- These "high churn" files are NOT excluded because the changes are
largely an improvement:
```
test/functional/plugin/lsp_spec.lua | 2198 ++++++++++++++++++---------------
test/functional/plugin/shada_spec.lua | 4078 +++++++++++++++++++++++++++++++++++-------------------------
test/functional/ui/cmdline_spec.lua | 1199 +++++++++++-------
test/functional/ui/popupmenu_spec.lua | 1267 +++++++++++--------
test/functional/ui/messages_spec.lua | 1643 +++++++++++++++---------
```
- TODO: how to check "all directories"? With `GLOB_DIRS *` and `/.deps/` (or
`.deps/`) in `.styluaignore`, Lua code in `.deps/` is still checked...
Problem:
Not all Lua code is checked by stylua. Automating code-style is an
important mechanism for reducing time spent on accidental
(non-essential) complexity.
Solution:
- Enable lintlua for `test/unit/` directory.
- TODO: only `test/functional/` remains unchecked.
previous: 45fe4d11ad
previous: 517f0cc634
Problem:
Not all Lua code is checked by stylua. Automating code-style is an
important mechanism for reducing time spent on accidental
(non-essential) complexity.
Solution:
- Enable lintlua for `src/` directory.
followup to 517f0cc634
Problem:
We don't enable stylua for many Lua scripts. Automating code-style is an
important tool for reducing time spent on accidental (non-essential)
complexity.
Solution:
- Enable lintlua for `scripts/` directory.
- Specify `call_parentheses = "Input"`, we should allow kwargs-style
function invocations.
add_glob_target is our custom method to figure out whether a work needs
to be done or not. This works as expected most of the time, but causes a
problem with stylua.
Stylua makes the decision that if a file is explicitly passed to be
formatted, then it will format the file even if the file is set to be
ignored in .styluaignore. This behavior breaks add_glob_target with
seemingly no easy workaround.
More information: https://github.com/JohnnyMorganz/StyLua/issues/751
Instead, what we can do is call stylua as you would in the command line.
This will make stylua work as expected. The downside is that we no
longer get a free "is this work necessary" detection, meaning that
stylua will be run each time `make lint` is called, regardless if it's
necessary or not. For longer lint tasks such as uncrustify and
clang-tidy this would be disastrous, but this is an acceptable tradeoff
since stylua is very quick.
* docs(options): take ownership of options.txt
- `src/nvim/options.lua` is now the source of truth
- generate runtime/lua/vim/_meta/options.lua
* fixup! zeer comments
* fixup! zeer comments (2)
* fixup! re-enable luacheck
* fixup! regen