Skip to content

Commit 83061d9

Browse files
authored
Merge pull request #37 from coder/refactor/makefile-test-runner
2 parents 406a4ca + 970a0d2 commit 83061d9

File tree

4 files changed

+17
-25
lines changed

4 files changed

+17
-25
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ jobs:
4949
version: ${{ matrix.neovim-version }}
5050

5151
- name: Run Luacheck
52-
run: nix develop .#ci -c luacheck lua/ tests/ --no-unused-args --no-max-line-length
52+
run: nix develop .#ci -c make check
5353

5454
- name: Run tests
55-
run: nix develop .#ci -c ./run_tests.sh
55+
run: nix develop .#ci -c make test
5656

5757
- name: Check formatting
5858
run: nix flake check

CLAUDE.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ claudecode.nvim - A Neovim plugin that implements the same WebSocket-based MCP p
1010

1111
### Testing
1212

13-
- `make test` - Run all tests using busted
14-
- `./run_tests.sh` - Direct test runner script
13+
- `make test` - Run all tests using busted with coverage
1514
- `busted tests/unit/specific_spec.lua` - Run specific test file
1615
- `busted --coverage -v` - Run tests with coverage
1716

@@ -85,3 +84,7 @@ Test files follow the pattern `*_spec.lua` or `*_test.lua` and use the busted fr
8584
- WebSocket server only accepts local connections for security
8685
- Selection tracking is debounced to reduce overhead
8786
- Terminal integration supports both snacks.nvim and native Neovim terminal
87+
88+
## CRITICAL: Pre-commit Requirements
89+
90+
**ALWAYS run `make` before committing any changes.** This runs code quality checks and formatting that must pass for CI to succeed. Never skip this step - many PRs fail CI because contributors don't run the build commands before committing.

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,16 @@ format:
2323

2424
# Run tests
2525
test:
26-
@echo "Running tests..."
27-
@./run_tests.sh
26+
@echo "Running all tests..."
27+
@export LUA_PATH="./lua/?.lua;./lua/?/init.lua;./?.lua;./?/init.lua;$$LUA_PATH"; \
28+
TEST_FILES=$$(find tests -type f -name "*_test.lua" -o -name "*_spec.lua" | sort); \
29+
echo "Found test files:"; \
30+
echo "$$TEST_FILES"; \
31+
if [ -n "$$TEST_FILES" ]; then \
32+
$(NIX_PREFIX) busted --coverage -v $$TEST_FILES; \
33+
else \
34+
echo "No test files found"; \
35+
fi
2836

2937
# Clean generated files
3038
clean:

run_tests.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)