From 178ae20381cd5ee0aaae551882294cc7a79f258f Mon Sep 17 00:00:00 2001 From: Oleg Tsvetkov Date: Thu, 16 Jul 2026 10:36:33 +0300 Subject: [PATCH 1/3] Add cljs-patrol docstring checks to CI Wire cljs-patrol (v0.0.17) into the pipeline as an npm run patrol step, scoped to the docstrings group over src/main with --fail-on all. The script caches the jar locally (gitignored) and CI runs it with the JDK already on the runner. Fix the two docstring-summary violations it reported: user-event/type and user-event/keyboard now open with a self-contained first-line summary sentence, per the bbatsov Clojure style guide. --- .github/workflows/test.yml | 1 + .gitignore | 1 + package.json | 1 + src/main/react_testing_library_cljs/user_event.cljs | 8 ++++---- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cf3fbe9..d5eda08 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,4 +28,5 @@ jobs: - run: npm ci - run: npm run fmt:check - run: npm run lint + - run: npm run patrol - run: npm test diff --git a/.gitignore b/.gitignore index c06f85c..021eaec 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,4 @@ pom.xml .repl node_modules pom.xml.asc +/cljs-patrol.jar diff --git a/package.json b/package.json index 9ec285d..4ff5f5d 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "test": "npx shadow-cljs compile test && node out/test.js", "test:watch": "npx shadow-cljs watch test --config-merge \"{:autorun true}\"", "lint": "clj-kondo --lint src", + "patrol": "[ -f cljs-patrol.jar ] || curl -sL https://github.com/olecve/cljs-patrol/releases/download/v0.0.17/cljs-patrol-0.0.17.jar -o cljs-patrol.jar; java -jar cljs-patrol.jar --only docstrings --fail-on all src/main", "fmt": "prettier --write \"**/*.{clj,cljs,cljc,edn}\"", "fmt:check": "prettier --check \"**/*.{clj,cljs,cljc,edn}\"" }, diff --git a/src/main/react_testing_library_cljs/user_event.cljs b/src/main/react_testing_library_cljs/user_event.cljs index 4f7ddd3..ad6555e 100644 --- a/src/main/react_testing_library_cljs/user_event.cljs +++ b/src/main/react_testing_library_cljs/user_event.cljs @@ -51,8 +51,8 @@ ([^js user element] (.unhover user element)) ([^js user element options] (.unhover user element (clj->js options)))) (defn type - "Types text into an element character by character, simulating the full - keyboard event sequence for each character. + "Types text into an element one character at a time. + Simulates the full keyboard event sequence for each character. See [type](https://testing-library.com/docs/user-event/utility/#type)." ([^js user element text] (.type user element text)) @@ -90,8 +90,8 @@ ([^js user] (.tab user)) ([^js user options] (.tab user (clj->js options)))) (defn keyboard - "Simulates keyboard events for the given key descriptor string, - e.g. {Enter}, a, {{a}}. + "Simulates keyboard events for the given key descriptor string. + For example `{Enter}`, `a`, or `{{a}}`. See [keyboard](https://testing-library.com/docs/user-event/keyboard)." ([^js user text] (.keyboard user text)) From 6a1a9460e678e29bbf018941febd8cba2de33269 Mon Sep 17 00:00:00 2001 From: Oleg Tsvetkov Date: Thu, 16 Jul 2026 10:48:25 +0300 Subject: [PATCH 2/3] Run cljs-patrol via a deps.edn alias instead of downloading the jar Replace the curl-the-release-jar npm script with a deps.edn :patrol alias that pins cljs-patrol as a git dependency (v0.0.17, tag + sha) and runs cljs-patrol.core. npm run patrol now calls clojure -M:patrol, so the version is managed in deps.edn and resolved/cached by tools.deps rather than fetched as a prebuilt jar. CI installs the Clojure CLI via setup-clojure; ignore the .cpcache directory it produces. --- .github/workflows/test.yml | 4 ++++ .gitignore | 2 +- deps.edn | 9 +++++++++ package.json | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 deps.edn diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d5eda08..ab273e7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,6 +25,10 @@ jobs: with: version: "2026.05.25" + - uses: DeLaGuardo/setup-clojure@master + with: + cli: latest + - run: npm ci - run: npm run fmt:check - run: npm run lint diff --git a/.gitignore b/.gitignore index 021eaec..fc83c8c 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ /checkouts /dev-resources/public/js/* /out +/.cpcache /.clj-kondo/.cache /.clj-kondo/imports /.lsp @@ -50,4 +51,3 @@ pom.xml .repl node_modules pom.xml.asc -/cljs-patrol.jar diff --git a/deps.edn b/deps.edn new file mode 100644 index 0000000..be4f2e0 --- /dev/null +++ b/deps.edn @@ -0,0 +1,9 @@ +{:aliases + {:patrol + {:deps {io.github.olecve/cljs-patrol + {:git/tag "v0.0.17" + :git/sha "1616b8d0daec1ffa7d8cec6f9ce08348d837202a"}} + :main-opts ["-m" "cljs-patrol.core" + "--only" "docstrings" + "--fail-on" "all" + "src/main"]}}} diff --git a/package.json b/package.json index 4ff5f5d..d3be979 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "test": "npx shadow-cljs compile test && node out/test.js", "test:watch": "npx shadow-cljs watch test --config-merge \"{:autorun true}\"", "lint": "clj-kondo --lint src", - "patrol": "[ -f cljs-patrol.jar ] || curl -sL https://github.com/olecve/cljs-patrol/releases/download/v0.0.17/cljs-patrol-0.0.17.jar -o cljs-patrol.jar; java -jar cljs-patrol.jar --only docstrings --fail-on all src/main", + "patrol": "clojure -M:patrol", "fmt": "prettier --write \"**/*.{clj,cljs,cljc,edn}\"", "fmt:check": "prettier --check \"**/*.{clj,cljs,cljc,edn}\"" }, From a05996c04595582f10465203d8deb1f2c5b2b00e Mon Sep 17 00:00:00 2001 From: Oleg Tsvetkov Date: Thu, 16 Jul 2026 10:56:06 +0300 Subject: [PATCH 3/3] Run all cljs-patrol rule groups, not just docstrings Drop --only docstrings from the :patrol alias so the full rule set (re-frame, Spade, typography, a11y, docstrings) runs against src/main with --fail-on all. The whole codebase already passes every rule. --- deps.edn | 1 - 1 file changed, 1 deletion(-) diff --git a/deps.edn b/deps.edn index be4f2e0..edf4029 100644 --- a/deps.edn +++ b/deps.edn @@ -4,6 +4,5 @@ {:git/tag "v0.0.17" :git/sha "1616b8d0daec1ffa7d8cec6f9ce08348d837202a"}} :main-opts ["-m" "cljs-patrol.core" - "--only" "docstrings" "--fail-on" "all" "src/main"]}}}