Skip to content

Commit 27177dd

Browse files
committed
ci: add make lint and pre-commit hook
1 parent 3fba29d commit 27177dd

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

.githooks/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
echo "Running lint checks..."
5+
make lint

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
# Run formatting and linting checks (matches CI)
2+
lint:
3+
stylua --check lua/ --config-path=.stylua.toml
4+
luacheck lua/ --globals vim
5+
6+
# Auto-fix formatting
7+
fmt:
8+
stylua lua/ --config-path=.stylua.toml
9+
110
# Run all test files
211
# test: deps/mini.nvim
3-
test:
12+
test:
413
nvim --headless --noplugin -u ./tests/scripts/minimal_init.lua -c "lua MiniTest.run()"
514

615
# Run test from file at `$FILE` environment variable

lua/copilot/suggestion/init.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,8 @@ function M.update_preview(ctx)
304304

305305
local suggestion_first_line = string.sub(suggestion.text, 1, (string.find(suggestion.text, "\n", 1, true) or 0) - 1)
306306
local range_start_char = suggestion.range and suggestion.range.start and suggestion.range.start.character or 0
307-
displayLines[1] = suggestion_util.get_display_adjustments(suggestion_first_line, range_start_char, cursor_col, current_line)
307+
displayLines[1] =
308+
suggestion_util.get_display_adjustments(suggestion_first_line, range_start_char, cursor_col, current_line)
308309

309310
local suggestion_line1 = displayLines[1]
310311

0 commit comments

Comments
 (0)