Skip to content

Commit 498fabe

Browse files
committed
ci fixes
1 parent 5142f02 commit 498fabe

File tree

12 files changed

+147
-83
lines changed

12 files changed

+147
-83
lines changed

.github/workflows/.luarc-5.1.json

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,25 @@
44
"libraryFiles": "Disable"
55
},
66
"runtime": {
7-
"version": "LuaJIT",
8-
"path": [
9-
"lua/?.lua",
10-
"lua/?/init.lua",
11-
"library/?.lua",
12-
"library/?/init.lua"
13-
]
7+
"version": "Lua 5.1"
148
},
159
"workspace": {
1610
"checkThirdParty": "Disable",
1711
"library": [
18-
"$PWD/.dependencies/pack/vendor/start/plenary.nvim",
19-
"$PWD/.dependencies/pack/vendor/start/nui.nvim",
20-
"$PWD/.dependencies/pack/vendor/start/nvim-web-devicons",
21-
"$PWD/.dependencies/pack/vendor/start/snacks.nvim",
22-
"${3rd}/luassert",
23-
"${3rd}/busted",
24-
"${3rd}/luv",
25-
"$VIMRUNTIME"
12+
"$VIMRUNTIME/lua",
13+
"$PWD/.dependencies/pack/vendor/start/plenary.nvim/lua",
14+
"$PWD/.dependencies/pack/vendor/start/nui.nvim/lua",
15+
"$PWD/.dependencies/pack/vendor/start/nvim-web-devicons/lua",
16+
"$PWD/.dependencies/pack/vendor/start/image.nvim/lua",
17+
"$PWD/.dependencies/pack/vendor/start/snacks.nvim/lua",
18+
"${3rd}/luassert/library",
19+
"${3rd}/busted/library"
2620
],
2721
"ignoreDir": [
2822
".dependencies",
2923
".luarocks",
30-
".lua"
24+
".lua",
25+
".repro"
3126
]
3227
}
3328
}

.github/workflows/.luarc-luajit-master.json

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,26 @@
44
"libraryFiles": "Disable"
55
},
66
"runtime": {
7-
"version": "LuaJIT",
8-
"path": [
9-
"lua/?.lua",
10-
"lua/?/init.lua",
11-
"library/?.lua",
12-
"library/?/init.lua"
13-
]
7+
"version": "LuaJIT"
148
},
159
"workspace": {
1610
"checkThirdParty": "Disable",
1711
"library": [
18-
"$PWD/.dependencies/pack/vendor/start/plenary.nvim",
19-
"$PWD/.dependencies/pack/vendor/start/nui.nvim",
20-
"$PWD/.dependencies/pack/vendor/start/nvim-web-devicons",
21-
"$PWD/.dependencies/pack/vendor/start/snacks.nvim",
22-
"${3rd}/luassert",
23-
"${3rd}/busted",
24-
"${3rd}/luv",
25-
"$VIMRUNTIME"
12+
"$VIMRUNTIME/lua",
13+
"$PWD/.dependencies/pack/vendor/start/plenary.nvim/lua",
14+
"$PWD/.dependencies/pack/vendor/start/nui.nvim/lua",
15+
"$PWD/.dependencies/pack/vendor/start/nvim-web-devicons/lua",
16+
"$PWD/.dependencies/pack/vendor/start/image.nvim/lua",
17+
"$PWD/.dependencies/pack/vendor/start/snacks.nvim/lua",
18+
"${3rd}/luassert/library",
19+
"${3rd}/busted/library",
20+
"${3rd}/luv/library"
2621
],
2722
"ignoreDir": [
2823
".dependencies",
2924
".luarocks",
30-
".lua"
25+
".lua",
26+
".repro"
3127
]
3228
}
3329
}

.github/workflows/luals-check.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,17 @@ jobs:
2121
with:
2222
luaVersion: ${{matrix.lua}}
2323

24-
- name: Install lua-language-server
24+
- name: Install tools
2525
uses: jdx/mise-action@v2
2626
with:
27-
mise_toml: |
28-
[tools]
29-
neovim = "${{ matrix.neovim }}"
30-
cargo-binstall = "latest"
31-
"cargo:emmylua_check" = "latest"
32-
"cargo:emmylua_ls" = "latest"
33-
lua-language-server = "3.13.9"
27+
install_args: "neovim"
3428

3529
- name: Run lua-language-server check
3630
run: |
37-
LUARC=".github/workflows/.luarc-${{ matrix.lua }}.json"
38-
make luals-check CONFIGURATION="$LUARC"
31+
mise use neovim
32+
NEOTREE_LUARC=".github/workflows/.luarc-${{ matrix.lua }}.json" mise run luals-check
3933
4034
- name: Run emmylua_check
4135
continue-on-error: true # Doesn't type-check well enough to be worth erroring on, but this runs so fast we might as well help test this out.
4236
run: |
43-
LUARC=".github/workflows/.luarc-${{ matrix.lua }}.json"
44-
make emmylua-check CONFIGURATION="$LUARC"
37+
NEOTREE_LUARC=".github/workflows/.luarc-${{ matrix.lua }}.json" mise run emmylua-check

.luarc.json

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,19 @@
44
"libraryFiles": "Disable"
55
},
66
"runtime": {
7-
"version": "LuaJIT",
8-
"path": [
9-
"lua/?.lua",
10-
"lua/?/init.lua",
11-
"library/?.lua",
12-
"library/?/init.lua"
13-
]
7+
"version": "LuaJIT"
148
},
159
"workspace": {
1610
"checkThirdParty": "Disable",
1711
"library": [
18-
"$PWD/.dependencies/pack/vendor/start/plenary.nvim",
19-
"$PWD/.dependencies/pack/vendor/start/nui.nvim",
20-
"$PWD/.dependencies/pack/vendor/start/nvim-web-devicons",
21-
"$PWD/.dependencies/pack/vendor/start/snacks.nvim",
22-
"${3rd}/luassert",
23-
"${3rd}/busted",
24-
"${3rd}/luv",
25-
"$VIMRUNTIME"
12+
"$VIMRUNTIME/lua",
13+
"$PWD/.dependencies/pack/vendor/start/plenary.nvim/lua",
14+
"$PWD/.dependencies/pack/vendor/start/nui.nvim/lua",
15+
"$PWD/.dependencies/pack/vendor/start/nvim-web-devicons/lua",
16+
"$PWD/.dependencies/pack/vendor/start/image.nvim/lua",
17+
"$PWD/.dependencies/pack/vendor/start/snacks.nvim/lua",
18+
"${3rd}/luassert/library",
19+
"${3rd}/busted/library"
2620
],
2721
"ignoreDir": [
2822
".dependencies",

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ $(DEPS)/plenary.nvim: $(DEPS)
3030
$(DEPS)/snacks.nvim: $(DEPS)
3131
@test -d "$(DEPS)/snacks.nvim" || git clone https://github.com/folke/snacks.nvim "$(DEPS)/snacks.nvim"
3232

33-
setup: $(DEPS)/nui.nvim $(DEPS)/nvim-web-devicons $(DEPS)/plenary.nvim $(DEPS)/snacks.nvim
33+
$(DEPS)/image.nvim: $(DEPS)
34+
@test -d "$(DEPS)/image.nvim" || git clone https://github.com/3rd/image.nvim "$(DEPS)/image.nvim"
35+
36+
setup: $(DEPS)/nui.nvim $(DEPS)/nvim-web-devicons $(DEPS)/plenary.nvim $(DEPS)/snacks.nvim $(DEPS)/image.nvim
3437
@echo "[setup] environment ready"
3538

3639
.PHONY: clean

lua/neo-tree/sources/filesystem/lib/fs_scan.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,6 @@ local function get_children_async(path, callback)
201201
return
202202
end
203203
local readdir_batch
204-
---@param _ string?
205-
---@param stats uv.fs_readdir.entry[]
206204
readdir_batch = function(_, stats)
207205
if stats then
208206
local more = false

lua/neo-tree/types/fixes/uv.lua

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ local uv = {}
99
--- `uv.fs_readdir()`. The `entries` parameter defines the maximum number of entries
1010
--- that should be returned by each call to `uv.fs_readdir()`.
1111
--- @param path string
12-
--- @param entries integer?
13-
--- @return uv.luv_dir_t? dir
14-
--- @return string? err
15-
--- @return string? err_name
16-
--- @overload fun(path: string, callback: fun(err: string?, dir: uv.luv_dir_t?), entries: integer?): uv.uv_fs_t
17-
function uv.fs_opendir(path, entries) end
18-
19-
--- Equivalent to `lstat(2)`.
20-
--- @param path string
21-
--- @return uv.fs_stat.result? stat
22-
--- @return string? err
23-
--- @return string? err_name
24-
--- @overload fun(path: string, callback: fun(err: string?, stat: uv.fs_stat.result?)): uv.uv_fs_t
25-
function uv.fs_lstat(path) end
12+
---
13+
--- **Returns (sync version):** `luv_dir_t userdata` or `fail`
14+
---
15+
--- **Returns (async version):** `uv_fs_t userdata`
16+
---
17+
---@param path string
18+
---@param callback nil
19+
---@param entries integer?
20+
---@return uv.luv_dir_t|nil dir
21+
---@return uv.error.message|nil err
22+
---@return uv.error.name|nil err_name
23+
---
24+
---@overload fun(path: string, callback: uv.fs_opendir.callback, entries?: integer):uv.uv_fs_t
25+
function uv.fs_opendir(path, callback, entries) end

mise.toml

Lines changed: 84 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,86 @@
11
[tools]
2-
cargo-binstall = "latest"
3-
"cargo:emmylua_check" = "latest"
4-
"cargo:emmylua_ls" = "latest"
52
lua-language-server = "latest"
3+
4+
[tasks.test]
5+
run = """
6+
#!/usr/bin/env bash
7+
nvim --headless --noplugin -u tests/mininit.lua -c "lua require('plenary.test_harness').test_directory('tests/neo-tree/', {minimal_init='tests/mininit.lua',sequential=true})"
8+
"""
9+
10+
[tasks.test-docker]
11+
run = [
12+
"docker build -t neo-tree .",
13+
"docker run --rm neo-tree mise test"
14+
]
15+
hide = true # hide this task from the list
16+
17+
[tasks.format]
18+
run = "stylua --glob '*.lua' --glob '!defaults.lua' ."
19+
20+
[vars]
21+
deps_dir = '.dependencies/pack/vendor/start'
22+
23+
[env]
24+
NEOTREE_LUARC = ".luarc.json"
25+
26+
[tasks.update-dependencies]
27+
alias = 'deps'
28+
run = """
29+
#!/usr/bin/env bash
30+
update() {
31+
local git_url="$1"
32+
local repo_name="$2"
33+
34+
mkdir -p "{{vars.deps_dir}}"
35+
36+
local target_dir="{{vars.deps_dir}}/$repo_name"
37+
if [ -d "$target_dir" ]; then
38+
echo "==> Directory '$target_dir' exists. Updating $repo_name..."
39+
git -C $target_dir fetch --tags -f
40+
git -C $target_dir pull
41+
42+
# Check the exit code of the subshell command
43+
if [ $? -ne 0 ]; then
44+
echo "Error: Failed to pull updates for '$repo_name'." >&2
45+
return 1
46+
fi
47+
echo "==> Successfully updated '$repo_name'."
48+
49+
else
50+
echo "==> Directory '$target_dir' not found. Cloning repository..."
51+
git clone "$git_url" "$target_dir"
52+
53+
if [ $? -ne 0 ]; then
54+
echo "Error: Failed to clone '$git_url'." >&2
55+
return 1
56+
fi
57+
echo "==> Successfully cloned '$repo_name'."
58+
fi
59+
}
60+
update https://github.com/3rd/image.nvim image.nvim
61+
update https://github.com/folke/snacks.nvim snacks.nvim
62+
update https://github.com/MunifTanjim/nui.nvim nui.nvim
63+
update https://github.com/nvim-tree/nvim-web-devicons nvim-web-devicons
64+
update https://github.com/nvim-lua/plenary.nvim plenary.nvim
65+
"""
66+
67+
[tasks.luals-check]
68+
run = """
69+
#!/usr/bin/env bash
70+
VIMRUNTIME_PATH=$(nvim --clean --headless --cmd 'lua io.write(vim.env.VIMRUNTIME)' --cmd 'quit')
71+
VIMRUNTIME="${VIMRUNTIME_PATH}" lua-language-server --configpath=$NEOTREE_LUARC --check=.
72+
"""
73+
depends = ['deps']
74+
75+
[tasks.emmylua-check]
76+
run = """
77+
#!/usr/bin/env bash
78+
VIMRUNTIME_PATH=$(nvim --clean --headless --cmd 'lua io.write(vim.env.VIMRUNTIME)' --cmd 'quit')
79+
VIMRUNTIME="${VIMRUNTIME_PATH}" emmylua_check -c $NEOTREE_LUARC -i ".dependencies/**" -- .
80+
"""
81+
depends = ['deps']
82+
83+
[tasks.clean]
84+
run = [
85+
"rm {{vars.deps_dir}} -rf"
86+
]

release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
REPO="nvim-neo-tree/neo-tree.nvim"
33
LAST_VERSION=$(curl --silent "https://api.github.com/repos/$REPO/releases/latest" | jq -r .tag_name)
44
echo "LAST_VERSION=$LAST_VERSION"

tests/neo-tree/command/command_current_spec.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ end
1717

1818
local run_close_command = function(command)
1919
vim.cmd(command)
20-
u.wait_for(function() end, { interval = 200, timeout = 200 })
20+
u.wait_for(function()
21+
return false
22+
end, { interval = 200, timeout = 200 })
2123
end
2224

2325
describe("Command", function()

0 commit comments

Comments
 (0)