Skip to content

Commit 5ffb874

Browse files
committed
feat(nvim): add lua-language-server type check script for neovim types
1 parent 411b478 commit 5ffb874

13 files changed

Lines changed: 105 additions & 12 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ jobs:
7676
command: check:shellcheck
7777
- name: Selene
7878
command: check:selene
79+
- name: Neovim Types
80+
command: check:neovim-types
7981
- name: Zizmor
8082
command: check:zizmor
8183
- name: Pinact

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,11 @@
107107
See [`.config/qmk-userspace`](https://github.com/kutsan/dotfiles/tree/main/home/dot_config/exact_qmk-userspace) folder for the QMK configuration.
108108

109109
<!-- KEYBOARD-DOCS:START -->
110+
110111
### keychron/v4/ansi (main)
111112

112113
![keychron/v4/ansi](.github/assets/keyboard-keychron-v4-ansi-main.svg)
114+
113115
<!-- KEYBOARD-DOCS:END -->
114116

115117
## License
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{
22
"trustedtaps": ["docker/tap", "osx-cross/arm", "osx-cross/avr", "qmk/qmk"],
3-
"trustedformulae": [
4-
"asmvik/formulae/yabai",
5-
"django23/tap/asimov"
6-
],
3+
"trustedformulae": ["asmvik/formulae/yabai", "django23/tap/asimov"],
74
"trustedcasks": ["docker/tap/sbx", "jackielii/tap/skhd-zig"]
85
}

home/dot_config/exact_nvim/exact_lsp/lua_ls.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ local LspConfig = {
2020
end
2121

2222
client.config.settings.Lua =
23-
vim.tbl_deep_extend('force', client.config.settings.Lua, {
23+
vim.tbl_deep_extend('force', client.config.settings.Lua --[[@as table]], {
2424
runtime = {
2525
version = 'LuaJIT',
2626
path = {

home/dot_config/exact_nvim/exact_lua/exact_user/exact_api/exact_keymaps/buffer.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ local function remove(opts)
66

77
-- Do nothing if buffer is in modified state.
88
if
9-
not opts.force and vim.api.nvim_buf_get_option(target_buf_id, 'modified')
9+
not opts.force
10+
and vim.api.nvim_get_option_value('modified', { buf = target_buf_id })
1011
then
1112
return false
1213
end

mise.lock

Lines changed: 57 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mise.toml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
[settings]
22
lockfile = true
33

4-
[task_config]
5-
includes = ["tasks"]
6-
74
[tools]
85
chezmoi = "2.70.5"
96
shellcheck = "0.11.0"
@@ -15,6 +12,8 @@ actionlint = "1.7.12"
1512
"pipx:keymap-drawer" = "0.23.0"
1613
taplo = "0.10.0"
1714
node = "26.5.0"
15+
lua-language-server = "3.18.2"
16+
neovim = "0.12.4"
1817

1918
[tasks.check]
2019
depends = [
@@ -26,6 +25,7 @@ depends = [
2625
"check:shfmt",
2726
"check:taplo",
2827
"check:actionlint",
28+
"check:neovim-types",
2929
]
3030

3131
[tasks."check:prettier"]
@@ -46,9 +46,21 @@ run = "git ls-files -z '*.sh' '*.zsh' | xargs -0 shfmt --diff"
4646
[tasks."check:taplo"]
4747
run = "taplo format --check"
4848

49+
[tasks."check:selene"]
50+
run = "bash tasks/check/selene.sh"
51+
52+
[tasks."check:shellcheck"]
53+
run = "bash tasks/check/shellcheck.sh"
54+
55+
[tasks."check:neovim-types"]
56+
run = "bash tasks/check/neovim-types.sh"
57+
4958
[tasks."update:pinact"]
5059
run = "pinact run --update"
5160

61+
[tasks."update:zsh-plugins"]
62+
run = "bash tasks/update/zsh-plugins.sh"
63+
5264
[tasks.format]
5365
depends = ["format:prettier", "format:shfmt", "format:taplo"]
5466

@@ -62,4 +74,4 @@ run = "git ls-files -z '*.sh' '*.zsh' | xargs -0 shfmt --write"
6274
run = "taplo format"
6375

6476
[tasks."docs:generate-keyboard-docs"]
65-
run = "node tasks/docs/generate-keyboard-docs/main.ts"
77+
run = "node tasks/docs/generate-keyboard-docs.ts"

tasks/check/neovim-types.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
IFS=$'\n\t'
5+
6+
readonly NVIM_CONFIG_DIR="home/dot_config/exact_nvim"
7+
8+
resolve_neovim_runtime_path() {
9+
nvim --clean --headless \
10+
--cmd 'lua io.write(vim.env.VIMRUNTIME)' \
11+
--cmd 'quit' 2>/dev/null
12+
}
13+
14+
main() {
15+
local neovim_runtime_path
16+
neovim_runtime_path=$(resolve_neovim_runtime_path)
17+
18+
VIMRUNTIME="$neovim_runtime_path" \
19+
lua-language-server --check "$NVIM_CONFIG_DIR"
20+
}
21+
22+
main "$@"

tasks/check/selene.sh

100755100644
File mode changed.

tasks/check/shellcheck.sh

100755100644
File mode changed.

0 commit comments

Comments
 (0)