Skip to content

test: add tests for all tools#76

Merged
xiaoshihou514 merged 10 commits intonvimdev:mainfrom
barrettruth:test/all-tools
Feb 10, 2026
Merged

test: add tests for all tools#76
xiaoshihou514 merged 10 commits intonvimdev:mainfrom
barrettruth:test/all-tools

Conversation

@barrettruth
Copy link
Contributor

@barrettruth barrettruth commented Feb 6, 2026

Adds test coverage for ALL formatters and linters using the revamped architecture.

New tools tested in this PR: literally all remaining ones
update Makefile with new CI job categories

closes #67 (6-7 reference)

@barrettruth barrettruth marked this pull request as ready for review February 6, 2026 23:36
@xiaoshihou514
Copy link
Member

Please don't change the config unless it's really incompatible with the tool's latest stable... If you really need to, leave a note in the pr so that I can verify 🙏.

@barrettruth
Copy link
Contributor Author

barrettruth commented Feb 7, 2026

Note that after this pr gets rebased onto main after the other ones are merged, the only config change made was the -e flag in ruff - which has been deprecated (actually, it doesn't even work) in favor of check. So low key it's a prerequisite for this code & test to pass for ruff.

@barrettruth barrettruth force-pushed the test/all-tools branch 2 times, most recently from 472fe62 to 83fb825 Compare February 8, 2026 21:42
@barrettruth
Copy link
Contributor Author

done. r4r! @xiaoshihou514

@xiaoshihou514
Copy link
Member

For jar releases, I think there's sdk man that provides you with a single executable (dunno if that's through graal or a wrapper).

@xiaoshihou514
Copy link
Member

For lint specs, it should actually use the configs instead of recreating the command again.

@xiaoshihou514
Copy link
Member

In the workflow file, luarocks, vim setup etc was repeated many times. Could you investigate if there's a way to refactor this?

@barrettruth barrettruth force-pushed the test/all-tools branch 3 times, most recently from 6d888e5 to e70d673 Compare February 9, 2026 06:22
@xiaoshihou514
Copy link
Member

Blocked by comments above for now :)

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.
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.
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.
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.
@barrettruth
Copy link
Contributor Author

barrettruth commented Feb 9, 2026

  1. we are now reusing the configs across all (EXCEPT for fn = -like linters, an issue is open for that now, including cpplint, prettierd, zsh)
  2. i deem sdkman to NOT be worth it because ktfmt, ktlint, and google-java-format are not available (ktlint was even removed)
  3. about the workflows, great point. i've made a refactor. see if you like it - I think it's way better!

@xiaoshihou514

@xiaoshihou514
Copy link
Member

It's much cleaner now, I think it's almost ready :)

  • cljfmt: probably best to use their install script
  • Long apt install cmd somewhere
  • I haven't looked at the linters yet

@barrettruth
Copy link
Contributor Author

Just addressed both:

  • cljfmt: Switched to the standalone binary from their github release, it's now in binary.txt
  • apt packages have been extracted to .github/tools/binary-apt.txt, read via xargs like the other tool lists.

@xiaoshihou514
Copy link
Member

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.
@barrettruth
Copy link
Contributor Author

barrettruth commented Feb 9, 2026

sorry... fixed!

accidentally applied commits to #81

Tests failing because of github actions being down (AGAIN!)

- name: Install tools
run: |
mkdir -p $HOME/.local/bin
printf '#!/bin/sh\nclojure -Sdeps '"'"'{:deps {dev.weavejester/cljfmt {:mvn/version "0.13.0"}}}'"'"' -M -m cljfmt.main "$@"\n' > $HOME/.local/bin/cljfmt && chmod +x $HOME/.local/bin/cljfmt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What? Surely there's a better way. Maybe through clojure's pm lein?

Comment on lines 268 to 269
printf "source 'https://rubygems.org'\ngem 'rubocop'\n" > /tmp/rubocop-test/Gemfile
cd /tmp/rubocop-test && bundle install
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, probably a way to install it globally.

Comment on lines 304 to 307
- name: Pre-warm cljfmt deps
run: |
export PATH="$HOME/.local/bin:$PATH"
echo "" | cljfmt fix - || true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is such a hack... See above.

@@ -0,0 +1,25 @@
describe('cbfmt', function()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why doesn't this use test.helper?

@xiaoshihou514
Copy link
Member

xiaoshihou514 commented Feb 10, 2026

https://github.com/barrettruth/guard-collection/blob/test%2Fall-tools/.github%2Fworkflows%2Fci.yaml#L163-L165

Can it be installed globally? (I know the config uses pm to launch it)

Problem: rubocop formatter and linter definitions used
`bundle exec rubocop`, requiring a Gemfile and bundle install
in both tests and CI.

Solution: invoke rubocop directly via `gem install rubocop`.
Remove Gemfile setup from test and CI.
@barrettruth
Copy link
Contributor Author

barrettruth commented Feb 10, 2026

cbfmt uses run_* test function, cljfmt & rubocop installation updated, unecessary pre-warm step removed.

anything else? if not, feel free to merge

(once again, i don't have permission)

@xiaoshihou514
Copy link
Member

yep

@xiaoshihou514 xiaoshihou514 merged commit ea1d770 into nvimdev:main Feb 10, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci testing

2 participants