Commit edf6c86
authored
refactor: convert checkmake and prettierd from fn to standard config (#81)
* test: add tests for all remaining tools
Problem: most formatters and linters in guard-collection had no test
coverage. The csharpier binary was renamed in v1.0+ and ruff's -e flag
was deprecated in favor of the check subcommand.
Solution: add 42 test files covering every remaining tool, fix the
csharpier and ruff definitions, extend the install script with gz/jar
archive types, add 6 new CI jobs (dotnet, ruby, clojure, elixir, nix,
swift), and expand existing jobs with newly tested tools.
* fix(ci): remove duplicate entry and untestable mypyc test
* fix(ci): restore CI config lost during merge
Problem: the -X theirs merge strategy replaced the full test/all-tools
CI config with the smaller fix/broken-configs version, losing install
entries for dart, fish_indent, google-java-format, pg_format, tombi,
typos, typstyle, xmllint, and zigfmt.
Solution: restore binary.txt, ci.yaml, and install script from the
pre-merge test/all-tools state which already had all entries.
* ci: extract repeated test setup into composite action
Problem: every test job repeated the same 5 steps for neovim, lua,
luarocks, busted/nlua, and guard.nvim clone — 175 lines of duplication
across 15 jobs.
Solution: extract into .github/actions/test-setup/action.yml and
replace with a single `uses: ./.github/actions/test-setup` per job.
* fix(test): use run_lint/run_fmt instead of manual vim.system
Problem: rebase picked up old test versions that manually construct
commands instead of using the config-driven helpers, defeating the
purpose of testing the actual tool definitions.
Solution: replace all 14 affected test files with the upstream/main
versions that use run_lint/run_fmt. Add buf lint test using run_lint.
* refactor: convert checkmake and prettierd from fn to standard config
Problem: checkmake and prettierd used custom fn handlers to spawn
processes manually, duplicating what guard.nvim's standard cmd/args/parse
pipeline already does. This prevented their tests from using the shared
run_lint/run_fmt helpers.
Solution: replace fn with cmd/args/fname fields. Update tests to use
run_lint and run_fmt instead of manual vim.system calls.
* ci(cljfmt): use standalone binary and extract apt packages to file
Problem: cljfmt required a dedicated CI job with Java, Clojure CLI, a
hand-rolled wrapper script, and dep pre-warming. The binary job also had
an inline apt-get install command inconsistent with other tool lists.
Solution: switch cljfmt to the standalone GraalVM binary from GitHub
releases, move its test into test/binary/, delete the test-clojure job,
and extract the binary job's apt packages into binary-apt.txt.
* test: exercise fn-based linter configs via coroutine helper
Problem: cpplint and zsh tests bypassed the fn config entirely by
manually constructing vim.system calls, so drift between the test and
the actual config could go undetected.
Solution: add run_lint_fn helper that wraps the fn call in a coroutine
and pumps the event loop via vim.wait, then update cpplint and zsh
tests to use it.
* refactor(test): run assertions inside coroutine in run_lint_fn
Problem: run_lint_fn busy-waited on an intermediate output variable,
then ran parse and returned results outside the coroutine.
Solution: accept an assertion callback, run the full pipeline (fn,
parse, assertions) inside the coroutine, and poll only on a completion
flag.1 parent ea1d770 commit edf6c86
7 files changed
Lines changed: 53 additions & 91 deletions
File tree
- lua/guard-collection
- linter
- test
- binary
- npm
- pip
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
212 | 192 | | |
213 | 193 | | |
214 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
15 | 7 | | |
16 | 8 | | |
17 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 3 | + | |
| 4 | + | |
6 | 5 | | |
7 | 6 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 7 | + | |
20 | 8 | | |
21 | 9 | | |
22 | | - | |
| 10 | + | |
23 | 11 | | |
24 | 12 | | |
25 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
17 | 12 | | |
18 | 13 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
58 | 79 | | |
59 | 80 | | |
60 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
5 | 4 | | |
6 | 5 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 6 | + | |
| 7 | + | |
14 | 8 | | |
15 | 9 | | |
16 | | - | |
17 | | - | |
18 | | - | |
| 10 | + | |
19 | 11 | | |
20 | 12 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
18 | 12 | | |
19 | 13 | | |
0 commit comments