Skip to content

Commit 5d3ecbf

Browse files
author
Bruce Hauman
committed
Fix clj-kondo warnings: replace :refer :all, remove redundant let, fix docstring placement
- Replace :refer :all with explicit :refer [deftest is testing] in 23 test files - Remove 17 redundant let expressions across test files - Fix 10 misplaced docstrings to follow proper Clojure style All tests pass (295 tests, 2085 assertions, 0 failures)
1 parent 5e89709 commit 5d3ecbf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+366
-397
lines changed

src/clojure_mcp/agent/langchain/model.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@
498498
(create-model-builder-from-config nrepl-client-map model-key {} {}))
499499
([nrepl-client-map model-key config-overrides]
500500
(create-model-builder-from-config nrepl-client-map model-key config-overrides {:validate? true}))
501-
([nrepl-client-map model-key config-overrides {:keys [validate?] :or {validate? true} :as options}]
501+
([nrepl-client-map model-key config-overrides {:keys [validate?] :or {validate? true} :as _options}]
502502
(let [user-models (config/get-models nrepl-client-map)
503503
;; Look in user config first, then defaults
504504
base-config (or (get user-models model-key)

src/clojure_mcp/agent/langchain/schema.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
(.items (edn->sch items))
8787
(.build)))
8888

89-
(defmethod edn->sch :object [{:keys [properties description required] :as object}]
89+
(defmethod edn->sch :object [{:keys [properties description required] :as _object}]
9090
(let [obj-build
9191
(cond-> (JsonObjectSchema/builder)
9292
(not (string/blank? description)) (.description description)

src/clojure_mcp/core.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@
457457
[nrepl-client-atom working-dir {:keys [make-tools-fn
458458
make-prompts-fn
459459
make-resources-fn]
460-
:as component-factories}]
460+
:as _component-factories}]
461461
{:tools (when make-tools-fn
462462
(doall (make-tools-fn nrepl-client-atom working-dir)))
463463
:prompts (when make-prompts-fn

src/clojure_mcp/file_content.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
(McpSchema$EmbeddedResource. nil nil blob)))
8080

8181
(defn file-response->file-content [{:keys [::file-response]}]
82-
(let [{:keys [nio-path mime-type] :as ser-file} (serialized-file file-response)]
82+
(let [{:keys [mime-type] :as ser-file} (serialized-file file-response)]
8383
(cond
8484
(text-media-type? mime-type) (text-resource-content ser-file)
8585
(image-media-type? mime-type) (image-content ser-file)

src/clojure_mcp/main.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
;; Delegate to resources namespace
88
;; Note: working-dir param kept for compatibility with core API but unused
9-
(defn make-resources [nrepl-client-atom working-dir]
9+
(defn make-resources [nrepl-client-atom _working-dir]
1010
(resources/make-resources nrepl-client-atom))
1111

1212
;; Delegate to prompts namespace
1313
;; Note: working-dir param kept for compatibility with core API but unused
14-
(defn make-prompts [nrepl-client-atom working-dir]
14+
(defn make-prompts [nrepl-client-atom _working-dir]
1515
(prompts/make-prompts nrepl-client-atom))
1616

17-
(defn make-tools [nrepl-client-atom working-directory]
17+
(defn make-tools [nrepl-client-atom _working-directory]
1818
;; Use the refactored tools builder
1919
;; Note: working-directory param kept for compatibility with core API but unused
2020
(tools/build-all-tools nrepl-client-atom))
@@ -26,7 +26,7 @@
2626
([working-dir nrepl-client-atom]
2727
(make-prompts nrepl-client-atom working-dir)))
2828

29-
(defn ^:deprecated my-resources [nrepl-client-atom working-dir]
29+
(defn ^:deprecated my-resources [nrepl-client-atom _working-dir]
3030
(resources/make-resources nrepl-client-atom))
3131

3232
(defn ^:deprecated my-tools [nrepl-client-atom]

src/clojure_mcp/main_examples/shadow_main.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ JavaScript interop is fully supported including `js/console.log`, `js/setTimeout
5050
cljs-session))
5151

5252
;; when having a completely different connection for cljs
53-
(defn shadow-eval-tool-secondary-connection-tool [nrepl-client-atom {:keys [shadow-port shadow-build shadow-watch] :as config}]
53+
(defn shadow-eval-tool-secondary-connection-tool [nrepl-client-atom {:keys [shadow-port _shadow-build _shadow-watch] :as config}]
5454
(let [cljs-nrepl-client-map (core/create-additional-connection nrepl-client-atom {:port shadow-port})
5555
cljs-nrepl-client-atom (atom cljs-nrepl-client-map)]
5656
(start-shadow-repl
@@ -62,7 +62,7 @@ JavaScript interop is fully supported including `js/console.log`, `js/setTimeout
6262
(assoc :description description))))
6363

6464
;; when sharing the clojure and cljs repl
65-
(defn shadow-eval-tool [nrepl-client-atom {:keys [shadow-build shadow-watch] :as config}]
65+
(defn shadow-eval-tool [nrepl-client-atom {:keys [_shadow-build _shadow-watch] :as config}]
6666
(let [cljs-session (nrepl/new-session @nrepl-client-atom)
6767
_ (start-shadow-repl nrepl-client-atom cljs-session config)]
6868
(-> (eval-tool/eval-code nrepl-client-atom {:nrepl-session cljs-session})
@@ -74,7 +74,7 @@ JavaScript interop is fully supported including `js/console.log`, `js/setTimeout
7474
;; 2. or the user starts two processes one for clojure and then we connect to shadow
7575
;; as a secondary connection
7676

77-
(defn make-tools [nrepl-client-atom working-directory & [{:keys [port shadow-port shadow-build shadow-watch] :as config}]]
77+
(defn make-tools [nrepl-client-atom working-directory & [{:keys [port shadow-port _shadow-build _shadow-watch] :as config}]]
7878
(if (and port shadow-port (not= port shadow-port))
7979
(conj (main/make-tools nrepl-client-atom working-directory)
8080
(shadow-eval-tool-secondary-connection-tool nrepl-client-atom config))

src/clojure_mcp/prompt_cli.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@
395395
(defn -main
396396
"Main entry point for the CLI"
397397
[& args]
398-
(let [{:keys [options arguments errors summary]}
398+
(let [{:keys [options _arguments errors summary]}
399399
(cli/parse-opts args cli-options)]
400400

401401
(cond

src/clojure_mcp/prompts.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ After doing this provide a very brief (8 lines) summary of where we are and then
243243
(def save-new-prompt
244244
{:name "save_new_prompt"
245245
:description "Asks the user for a new prompt and a name, and saves them to their user config"
246-
:prompt-fn (fn [_ request-args clj-result-k]
246+
:prompt-fn (fn [_ _request-args clj-result-k]
247247
(clj-result-k
248248
{:description "Help user create/update a custom prompt"
249249
:messages [{:role :user
@@ -269,7 +269,7 @@ and using the following format:
269269
"Creates a prompt from configuration map.
270270
Config should have :description, :args, and either :file-path or :content.
271271
Uses pogonos/mustache templating for the content."
272-
[prompt-name {:keys [description args file-path content]} working-dir nrepl-client-atom]
272+
[prompt-name {:keys [description args file-path content]} working-dir _nrepl-client-atom]
273273
(let [;; Prepare arguments structure for MCP
274274
arguments (mapv (fn [{:keys [name description required?]}]
275275
{:name name

src/clojure_mcp/resources.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
Accepts nrepl-client-atom for consistency with create-file-resource, but doesn't use it.
4444
4545
:contents should be a vector of strings"
46-
[url name description mime-type contents & [nrepl-client-atom]]
46+
[url name description mime-type contents & [_nrepl-client-atom]]
4747
{:url url
4848
:name name
4949
:description description

src/clojure_mcp/sexp/match.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
(loop [loc zloc]
6767
(when-not (z/end? loc)
6868
(let [form (try (z/sexpr loc)
69-
(catch Exception e
69+
(catch Exception _e
7070
::continue))]
7171
(if (= ::continue form)
7272
(recur (z/next loc))

0 commit comments

Comments
 (0)