-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (45 loc) · 1.76 KB
/
Makefile
File metadata and controls
51 lines (45 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
all: fmt apply nvim-check
apply:
uv run ansible-playbook -i ~/.dotfiles/ansible/inventory.ini ~/.dotfiles/ansible/dotfiles.yml
fmt:
npx --loglevel error --yes prettier --write **/*.yml
uvx mdformat --wrap 80 --number *.md
uvx ruff format --line-length=100 **/*.py
uvx ruff check --fix --line-length=100 **/*.py
npx --loglevel error --yes @johnnymorganz/stylua-bin -- **/*.lua
fmt_check:
npx --loglevel error --yes prettier --check **/*.yml
uvx mdformat --check --wrap 80 --number *.md
uvx ruff format --check --line-length=100 **/*.py
uvx ruff check --line-length=100 **/*.py
npx --loglevel error --yes @johnnymorganz/stylua-bin --check -- **/*.lua
nvim-health:
nvim --headless "+checkhealth" +qa
# Smoke test: boot nvim with representative filetypes and fail on startup errors/warnings.
# Catches plugin misconfigurations (e.g. missing tree-sitter parsers, broken submodules)
# that produce warnings in :messages but pass :checkhealth.
NVIM_CHECK_FILETYPES := R py lua md
NVIM_CHECK_TMPDIR := /tmp/_nvim_check
NVIM_CHECK_TIMEOUT := 30
nvim-check:
@mkdir -p $(NVIM_CHECK_TMPDIR)
@fail=0; \
for ft in $(NVIM_CHECK_FILETYPES); do \
tmpfile="$(NVIM_CHECK_TMPDIR)/test.$$ft"; \
msgfile="$(NVIM_CHECK_TMPDIR)/messages_$$ft.txt"; \
touch "$$tmpfile"; \
timeout $(NVIM_CHECK_TIMEOUT) nvim --headless \
+"edit $$tmpfile" \
+"sleep 3" \
+"redir! > $$msgfile | silent messages | redir END" \
+"qall!" 2>/dev/null || true; \
if grep -qiE '(error|warning)' "$$msgfile" 2>/dev/null; then \
echo "FAIL [$$ft]: startup errors detected"; \
cat "$$msgfile"; \
fail=1; \
else \
echo "PASS [$$ft]: clean startup"; \
fi; \
done; \
rm -rf $(NVIM_CHECK_TMPDIR); \
[ "$$fail" -eq 0 ] || (echo "nvim-check: some filetypes had errors" && exit 1)