Add babashka compatibility + migrate tools.cli to parse-opts#356
Merged
lvh merged 12 commits intocloverage:masterfrom Feb 28, 2026
Merged
Add babashka compatibility + migrate tools.cli to parse-opts#356lvh merged 12 commits intocloverage:masterfrom
lvh merged 12 commits intocloverage:masterfrom
Conversation
…dley to 0.2.2 - Migrate from deprecated `cli/cli` API to `cli/parse-opts` with `:multi true` and `:update-fn conj` for repeated args (replacing `collecting-args-parser`) - Bump riddley 0.2.0 -> 0.2.2 (adds babashka compatibility) - Bump tools.cli 0.4.2 -> 1.1.230 - Simplify `var->sym` to use `(symbol fvar)` directly - Replace `.deref ^IDeref` with `@` in coverage.clj
Add bb.edn and deps.edn for running cloverage tests under babashka. Adapt source and tests for SCI differences: - Add `if-bb` macro for conditional test expectations - Use `(class f)` instead of `.getClass` in fn-sym, filter SCI internal fns - Skip inlined fn tests on bb (SCI doesn't support inlined functions) - Skip java interop tests on bb (clojure.lang.RT not available in native bb) - Normalize deftype expansion in test (bb expands directly to deftype*) - Add bb-specific expected report snapshots in test/resources/bb/ - Use with-redefs for dependency-sort test on bb (built-in nses lack source) 73 tests, 225 assertions, 0 failures, 0 errors on bb. 73 tests, 247 assertions, 0 failures, 0 errors on JVM.
Qualified methods and functional interface tests are now shared. Array class syntax test uses if-bb: copyOf for bb (binarySearch not in bb's reflection config), binarySearch for JVM.
The remove-dynamic-strings regex didn't account for pretty-printed JSON format (spaces around colon) used by bb's data.json. Normalize both service_job_id and service_name regardless of whitespace.
…ppress conditional requires
Contributor
Author
The rest of the changes should all be related to getting cloverage to run with babashka and should not introduce any new CI failures. |
Contributor
Author
|
Somehow all checks passed now |
- Use (symbol (str (.ns v)) (str (.sym v))) instead of (symbol v) for Var->symbol conversion, as (symbol var) is not supported on Clojure < 1.10 - Move Clojure 1.12 instrument tests to separate test-clj12/ dir to avoid reader errors from String/1 syntax on older Clojure - Make Thread/currentThread test expectation version-aware since it macroexpands differently on pre-1.12
Eastwood's bundled tools.reader doesn't support String/1 syntax.
SCI's .sym method on Var returns a namespace-qualified symbol, causing double-qualification in var->sym. Using .-sym field access returns just the name, consistent with JVM Clojure.
Contributor
Author
|
@lvh This PR now fixes a bunch of clojure 1.12 issues as well, CI all green. |
Collaborator
|
This looks great, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
JVM improvements (commit 1):
Babashka compatibility (commit 2):
Shared Clojure 1.12 tests (commit 3):
Tested