Skip to content

Commit 97801fc

Browse files
chore(ci): make check compatible within nix shell
Updates Makefile to avoid nested nix develop calls, ensuring make check/test work inside CI shell. Fixes luacheck warnings. Co-authored-by: ThomasK33 <[email protected]>
1 parent 5455fc9 commit 97801fc

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ all: format check test
66
# Check for syntax errors
77
check:
88
@echo "Checking Lua files for syntax errors..."
9-
nix develop .#ci -c find lua -name "*.lua" -type f -exec lua -e "assert(loadfile('{}'))" \;
9+
ifeq (,$(IN_NIX_SHELL))
10+
NIX_PREFIX=nix develop .#ci -c
11+
else
12+
NIX_PREFIX=
13+
endif
14+
$(NIX_PREFIX) find lua -name "*.lua" -type f -exec lua -e "assert(loadfile('{}'))" \;
1015
@echo "Running luacheck..."
11-
nix develop .#ci -c luacheck lua/ tests/ --no-unused-args --no-max-line-length
16+
$(NIX_PREFIX) luacheck lua/ tests/ --no-unused-args --no-max-line-length
1217

1318
# Format all files
1419
format:

lua/claudecode/diff.lua

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,6 @@ function M._cleanup_diff_layout(tab_name, target_win, new_win)
225225
logger.debug("diff", "[CLEANUP] Layout cleanup completed for:", tab_name)
226226
end
227227

228-
--- Open diff using native Neovim functionality
229-
-- @param old_file_path string Path to the original file
230-
-- @param new_file_path string Path to the new file (used for naming)
231-
-- @param new_file_contents string Contents of the new file
232-
-- @param tab_name string Name for the diff tab/view
233-
-- @return table Result with provider, tab_name, and success status
234228
-- Detect filetype from a path or existing buffer (best-effort)
235229
local function _detect_filetype(path, buf)
236230
-- 1) Try Neovim's builtin matcher if available (>=0.10)
@@ -276,6 +270,13 @@ local function _detect_filetype(path, buf)
276270
return simple_map[ext]
277271
end
278272

273+
--- Open diff using native Neovim functionality
274+
-- @param old_file_path string Path to the original file
275+
-- @param new_file_path string Path to the new file (used for naming)
276+
-- @param new_file_contents string Contents of the new file
277+
-- @param tab_name string Name for the diff tab/view
278+
-- @return table Result with provider, tab_name, and success status
279+
279280
function M._open_native_diff(old_file_path, new_file_path, new_file_contents, tab_name)
280281
local new_filename = vim.fn.fnamemodify(new_file_path, ":t") .. ".new"
281282
local tmp_file, err = M._create_temp_file(new_file_contents, new_filename)

0 commit comments

Comments
 (0)