Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Remove redundant kondo ignores (#84111)

Chris Truterfa525433e13e
diff --git a/.clj-kondo/ratchets-test.edn b/.clj-kondo/ratchets-test.edn
index 806402938d1..db8f8a12a42 100644
--- a/.clj-kondo/ratchets-test.edn
+++ b/.clj-kondo/ratchets-test.edn
@@ -51,6 +51,4 @@
:search.entity-retrieval.mirror/search-unfiltered 1
:test/with-temp 30}
:comment-exempt #{:deprecated-namespace
- :discouraged-namespace
- :discouraged-var
- :metabase/discourage-dynamic-vars}}
+ :discouraged-var}}
diff --git a/dev/src/dev/coverage.clj b/dev/src/dev/coverage.clj
index 9f8841c88d2..9faf0d2eeb8 100644
--- a/dev/src/dev/coverage.clj
+++ b/dev/src/dev/coverage.clj
@@ -323,7 +323,7 @@
partially-covered (sort-by :function (filter #(seq (:survived %)) fns))
fully-covered (sort-by :function (filter #(and (contains? % :tests)
(empty? (:survived %))) fns))
- s #_{:clj-kondo/ignore [:discouraged-var]} ;; it's wrapped in `with-out-str`
+ s
(with-out-str
(println "# Mutation Testing Namespace Report")
(println)
diff --git a/dev/src/dev/debug_qp.clj b/dev/src/dev/debug_qp.clj
index d836f09d728..ddb01bcbe7d 100644
--- a/dev/src/dev/debug_qp.clj
+++ b/dev/src/dev/debug_qp.clj
@@ -403,8 +403,6 @@
([sql]
(pprint-sql (mdb/db-type) sql))
([driver sql]
- ;; dev REPL helper; pretty SQL goes to the console for a human
- #_{:clj-kondo/ignore [:discouraged-var]}
(println (driver/prettify-native-form driver sql))))
(defonce ^:private portal (atom nil))
@@ -435,6 +433,4 @@
(stop-portal!)
(reset! portal (portal.api/start config))
(add-tap #'portal.api/submit)
- ;; dev REPL feedback; the startup notice goes to the console
- #_{:clj-kondo/ignore [:discouraged-var]}
(printf "Started Portal on port %d.\n" (:port config)))))
diff --git a/dev/src/dev/deps_graph.clj b/dev/src/dev/deps_graph.clj
index d6f8d9ce932..556a9c8100d 100644
--- a/dev/src/dev/deps_graph.clj
+++ b/dev/src/dev/deps_graph.clj
@@ -591,8 +591,6 @@
(let [deps (dependencies)
all-modules (into (sorted-set) (map :module) deps)
module-deps (set (keys (all-module-deps-paths deps module)))]
- ;; dev REPL tool; the summary line is for the human at the console
- #_{:clj-kondo/ignore [:discouraged-var]}
(printf "Module %s depends on %d/%d (%.1f%%) other modules.\n"
module
(count module-deps)
diff --git a/dev/src/dev/migrate.clj b/dev/src/dev/migrate.clj
index cdce353675b..0f7ee0450c6 100644
--- a/dev/src/dev/migrate.clj
+++ b/dev/src/dev/migrate.clj
@@ -43,8 +43,6 @@
;; do we really use this in dev?
([direction & [version]]
(mdb/migrate! (mdb/data-source) direction version)
- ;; dev migration CLI; status goes to stdout for the human running it
- #_{:clj-kondo/ignore [:discouraged-var]}
(println (format "Migrated %s. Latest migration: %s" (name direction) (latest-migration)))))
(defn- rollback-n-migrations!
@@ -118,8 +116,6 @@
(let [n (case (keyword k)
:last-deployment (last-deployment))]
(rollback-n-migrations! n)
- ;; dev migration CLI; status goes to stdout for the human running it
- #_{:clj-kondo/ignore [:discouraged-var]}
(println (format "Rollbacked %d migrations. Latest migration: %s" n (latest-migration)))))
([k :- [:enum :id :count "id" "count"]
@@ -128,15 +124,11 @@
:id (migration-since target)
:count (maybe-parse-long target))]
(rollback-n-migrations! n)
- ;; dev migration CLI; status goes to stdout for the human running it
- #_{:clj-kondo/ignore [:discouraged-var]}
(println (format "Rollbacked %d migrations. Latest migration: %s" n (latest-migration))))))
(defn migration-status
"Print the latest migration ID."
[]
- ;; dev migration CLI; status goes to stdout for the human running it
- #_{:clj-kondo/ignore [:discouraged-var]}
(println "Current migration:" (latest-migration)))
(defn -main
diff --git a/dev/src/dev/model_tracking.clj b/dev/src/dev/model_tracking.clj
index 93ab6e0a3e8..843526191f2 100644
--- a/dev/src/dev/model_tracking.clj
+++ b/dev/src/dev/model_tracking.clj
@@ -40,7 +40,6 @@
(= b :id) 1
:else (compare a b)))) m))
-#_{:clj-kondo/ignore [:discouraged-var]} ;; printlns
(defn on-change
"When a change occurred, execute this function.
diff --git a/dev/src/dev/modules_config.clj b/dev/src/dev/modules_config.clj
index b0145a65754..c2bed384ed3 100644
--- a/dev/src/dev/modules_config.clj
+++ b/dev/src/dev/modules_config.clj
@@ -289,17 +289,15 @@
(let [original (slurp config-path)
{:keys [text warnings]} (rewrite-config original (compute-desired))]
;; CLI tool output: mage fix-modules-config callers read these lines from stdout
- #_{:clj-kondo/ignore [:discouraged-var]}
(doseq [w warnings]
(println (str "WARNING: " w)))
(if (= text original)
;; CLI tool output: mage fix-modules-config callers read these lines from stdout
- (do #_{:clj-kondo/ignore [:discouraged-var]}
- (println "config.edn already up to date.")
- :unchanged)
+ (do
+ (println "config.edn already up to date.")
+ :unchanged)
(do (spit config-path text)
;; CLI tool output: mage fix-modules-config callers read these lines from stdout
- #_{:clj-kondo/ignore [:discouraged-var]}
(println "Updated" config-path)
:updated))))
diff --git a/dev/src/dev/toucan2_monitor.clj b/dev/src/dev/toucan2_monitor.clj
index 2d349267813..cbdac9b4400 100644
--- a/dev/src/dev/toucan2_monitor.clj
+++ b/dev/src/dev/toucan2_monitor.clj
@@ -150,6 +150,4 @@
(summary)
(to-csv!)
(doseq [q (querles)]
- ;; REPL scratch; stdout is the point
- #_{:clj-kondo/ignore [:discouraged-var]}
(println q)))
diff --git a/dev/test/dev/n_plus_one_detection_test.clj b/dev/test/dev/n_plus_one_detection_test.clj
index 7ab345c8988..845724d6528 100644
--- a/dev/test/dev/n_plus_one_detection_test.clj
+++ b/dev/test/dev/n_plus_one_detection_test.clj
@@ -11,7 +11,6 @@
(let [v (:one (t2/query-one {:select [[1 :one]]}))]
(assoc row k v)))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic *cached?* nil)
;; A simple hydration function that simulates caching. The first time it's called, it hits the database, but it
diff --git a/enterprise/backend/test/metabase_enterprise/database_routing/embedding_test.clj b/enterprise/backend/test/metabase_enterprise/database_routing/embedding_test.clj
index 2c262285d1f..5d613efb472 100644
--- a/enterprise/backend/test/metabase_enterprise/database_routing/embedding_test.clj
+++ b/enterprise/backend/test/metabase_enterprise/database_routing/embedding_test.clj
@@ -14,7 +14,6 @@
(defn random-embedding-secret-key [] (u.random/secure-hex 32))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic *secret-key* nil)
(defn sign [claims] (jwt/sign claims *secret-key*))
diff --git a/enterprise/backend/test/metabase_enterprise/impersonation/driver_test.clj b/enterprise/backend/test/metabase_enterprise/impersonation/driver_test.clj
index 3b719fed9b3..6e524e9dffa 100644
--- a/enterprise/backend/test/metabase_enterprise/impersonation/driver_test.clj
+++ b/enterprise/backend/test/metabase_enterprise/impersonation/driver_test.clj
@@ -338,6 +338,7 @@
(when-let [ids (seq (map u/the-id (vals (first (reset-vals! impersonation-databases {})))))]
;; the linter's concern is a fixture racing tests that share the rows it touches; these
;; ids were created by this namespace and are deleted after its last test finishes.
+ ;; [kondo-keep] suppresses a warning :redundant-ignore can't see; --audit rechecks
#_{:clj-kondo/ignore [:metabase/validate-deftest]}
(t2/delete! :model/Database :id [:in ids]))))))
diff --git a/enterprise/backend/test/metabase_enterprise/sandbox/query_processor/middleware/sandboxing_test.clj b/enterprise/backend/test/metabase_enterprise/sandbox/query_processor/middleware/sandboxing_test.clj
index 356ce04c99d..76e7f063a44 100644
--- a/enterprise/backend/test/metabase_enterprise/sandbox/query_processor/middleware/sandboxing_test.clj
+++ b/enterprise/backend/test/metabase_enterprise/sandbox/query_processor/middleware/sandboxing_test.clj
@@ -1420,7 +1420,6 @@
"Model failed to persist")
;; a sandboxed user has no native-query permissions, but only needs to be able to *read* a saved
;; native Card that references the persisted Model to hit this code path.
- #_{:clj-kondo/ignore [:discouraged-var]}
(mt/with-temp [:model/Card card {:dataset_query
(lib/native-query (mt/metadata-provider)
(format "SELECT count(*) FROM {{#%d}} AS m"
diff --git a/enterprise/backend/test/metabase_enterprise/scim/v2/api_test.clj b/enterprise/backend/test/metabase_enterprise/scim/v2/api_test.clj
index c82c5e563f5..3ab6dc326d8 100644
--- a/enterprise/backend/test/metabase_enterprise/scim/v2/api_test.clj
+++ b/enterprise/backend/test/metabase_enterprise/scim/v2/api_test.clj
@@ -13,7 +13,6 @@
(use-fixtures :once (fixtures/initialize :test-users))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic *scim-api-key* nil)
(defn with-scim-setup-impl!
diff --git a/enterprise/backend/test/metabase_enterprise/search/semantic/test_util.clj b/enterprise/backend/test/metabase_enterprise/search/semantic/test_util.clj
index 8a021912ccf..bd5867939ef 100644
--- a/enterprise/backend/test/metabase_enterprise/search/semantic/test_util.clj
+++ b/enterprise/backend/test/metabase_enterprise/search/semantic/test_util.clj
@@ -244,7 +244,6 @@
mock-documents-for-embeddings
base-embedding-vectors)))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic *extra-mock-embeddings*
"Dynamic var for test-specific mock embeddings. Merged with [[mock-embeddings]] in [[get-mock-embedding]]."
nil)
diff --git a/enterprise/backend/test/metabase_enterprise/search/semantic/vector_strategy_matrix_test.clj b/enterprise/backend/test/metabase_enterprise/search/semantic/vector_strategy_matrix_test.clj
index 6ce057161e4..18f5cdbf8d0 100644
--- a/enterprise/backend/test/metabase_enterprise/search/semantic/vector_strategy_matrix_test.clj
+++ b/enterprise/backend/test/metabase_enterprise/search/semantic/vector_strategy_matrix_test.clj
@@ -249,7 +249,6 @@
(throw (ex-info "vector-strategy matrix assumes the stock hnsw.ef_search default"
{:hnsw.ef_search ef-search}))))))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:private ^:dynamic *index*
"The semantic index the helpers below operate on; [[graph-approximation-test]] rebinds it."
semantic.tu/mock-index)
diff --git a/enterprise/backend/test/metabase_enterprise/sso/integrations/oidc_test.clj b/enterprise/backend/test/metabase_enterprise/sso/integrations/oidc_test.clj
index f6cd8093438..9e84c3a7015 100644
--- a/enterprise/backend/test/metabase_enterprise/sso/integrations/oidc_test.clj
+++ b/enterprise/backend/test/metabase_enterprise/sso/integrations/oidc_test.clj
@@ -193,12 +193,10 @@
;;; -------------------------------------------------- Group Sync Tests --------------------------------------------------
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:private ^:dynamic *group-sync-claims*
"Dynamic var to control what claims the group sync mock returns."
{:groups ["test-group"]})
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:private ^:dynamic *group-sync-email*
"Dynamic var to control the email returned by the group sync mock."
diff --git a/modules/drivers/databricks/test/metabase/driver/databricks_test.clj b/modules/drivers/databricks/test/metabase/driver/databricks_test.clj
index 59ab5b1b2f1..4fa3c029121 100644
--- a/modules/drivers/databricks/test/metabase/driver/databricks_test.clj
+++ b/modules/drivers/databricks/test/metabase/driver/databricks_test.clj
@@ -23,7 +23,6 @@
[metabase.util :as u]
[toucan2.core :as t2]))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic *multi-level?* false)
;; certain tests need to be run twice; once with the multi-level schema and once without.
diff --git a/modules/drivers/snowflake/test/metabase/driver/snowflake_test.clj b/modules/drivers/snowflake/test/metabase/driver/snowflake_test.clj
index 2f9bc524ecc..2fce67a3727 100644
--- a/modules/drivers/snowflake/test/metabase/driver/snowflake_test.clj
+++ b/modules/drivers/snowflake/test/metabase/driver/snowflake_test.clj
@@ -33,7 +33,7 @@
[metabase.lib.test-util :as lib.tu]
[metabase.lib.test-util.notebook-helpers :as notebook-helpers]
[metabase.query-processor.compile :as qp.compile]
- ^{:clj-kondo/ignore [:deprecated-namespace :discouraged-namespace]} [metabase.query-processor.store :as qp.store]
+ ^{:clj-kondo/ignore [:deprecated-namespace]} [metabase.query-processor.store :as qp.store]
[metabase.query-processor.test :as qp]
[metabase.secrets.core :as secret]
[metabase.sync.core :as sync]
diff --git a/src/metabase/driver/sql_jdbc/actions.clj b/src/metabase/driver/sql_jdbc/actions.clj
index 825b15bf12c..ccbe32b9c4e 100644
--- a/src/metabase/driver/sql_jdbc/actions.clj
+++ b/src/metabase/driver/sql_jdbc/actions.clj
@@ -1,6 +1,5 @@
(ns metabase.driver.sql-jdbc.actions
(:refer-clojure :exclude [some mapv select-keys empty? not-empty get-in])
- #_{:clj-kondo/ignore [:discouraged-namespace]} ;; for using toucan2 in this ns
(:require
[clojure.java.jdbc :as jdbc]
[clojure.set :as set]
diff --git a/src/metabase/driver/sql_jdbc/connection.clj b/src/metabase/driver/sql_jdbc/connection.clj
index 5ca8696fd68..0ba4fba8072 100644
--- a/src/metabase/driver/sql_jdbc/connection.clj
+++ b/src/metabase/driver/sql_jdbc/connection.clj
@@ -4,7 +4,6 @@
(:refer-clojure :exclude [get-in mapv select-keys])
(:require
[clojure.java.jdbc :as jdbc]
- ^{:clj-kondo/ignore [:discouraged-namespace]}
[metabase.audit-app.core :as audit-app]
[metabase.driver :as driver]
[metabase.driver-api.core :as driver-api]
diff --git a/test/metabase/actions/test_util.clj b/test/metabase/actions/test_util.clj
index df1966b5149..8317777d0e2 100644
--- a/test/metabase/actions/test_util.clj
+++ b/test/metabase/actions/test_util.clj
@@ -28,7 +28,6 @@
(set! *warn-on-reflection* true)
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic ^:private *actions-test-data-tables*
#{"categories"})
diff --git a/test/metabase/ai_tracing/log_test.clj b/test/metabase/ai_tracing/log_test.clj
index 7cb63e7bed8..aabb1904b04 100644
--- a/test/metabase/ai_tracing/log_test.clj
+++ b/test/metabase/ai_tracing/log_test.clj
@@ -4,7 +4,6 @@
;; needed to install a recording logger factory for the MDC-routing probe; no util.log equivalent
^{:clj-kondo/ignore [:discouraged-namespace]}
[clojure.tools.logging]
- ^{:clj-kondo/ignore [:discouraged-namespace]}
[clojure.tools.logging.impl]
[metabase.ai-tracing.core :as ait]
[metabase.ai-tracing.log :as ait.log]
diff --git a/test/metabase/analytics/snowplow_test.clj b/test/metabase/analytics/snowplow_test.clj
index 342289fc9b8..4737576c362 100644
--- a/test/metabase/analytics/snowplow_test.clj
+++ b/test/metabase/analytics/snowplow_test.clj
@@ -21,7 +21,6 @@
(use-fixtures :once (fixtures/initialize :db))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic *snowplow-collector*
"Fake Snowplow collector"
(atom []))
diff --git a/test/metabase/api/common_test.clj b/test/metabase/api/common_test.clj
index 3876afcc127..bb324e53e99 100644
--- a/test/metabase/api/common_test.clj
+++ b/test/metabase/api/common_test.clj
@@ -113,7 +113,6 @@
(is (= [1 2 3] (api/parse-multi-values-param ["1" "2" "3"] parse-long)))))
;; set up for testing permission failure event publishing
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic *events* nil)
(methodical/defmethod events/publish-event! ::permission-failure-event
diff --git a/test/metabase/dashboards_rest/api_test.clj b/test/metabase/dashboards_rest/api_test.clj
index 8fe9766db1e..ccecf01116f 100644
--- a/test/metabase/dashboards_rest/api_test.clj
+++ b/test/metabase/dashboards_rest/api_test.clj
@@ -1882,7 +1882,6 @@
(is (= (map #(dissoc % :id) original-tabs)
(map #(dissoc % :id) new-tabs))))))))))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic ^:private
^{:doc "Set of ids that will report [[mi/can-write]] as true."}
*readable-card-ids* #{})
diff --git a/test/metabase/embedding_rest/api/embed_test.clj b/test/metabase/embedding_rest/api/embed_test.clj
index 069f3d0cfee..d8f6d250946 100644
--- a/test/metabase/embedding_rest/api/embed_test.clj
+++ b/test/metabase/embedding_rest/api/embed_test.clj
@@ -38,7 +38,6 @@
(defn random-embedding-secret-key [] (u.random/secure-hex 32))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic *secret-key* nil)
(defn sign [claims] (jwt/sign claims *secret-key*))
diff --git a/test/metabase/embedding_rest/api/preview_embed_test.clj b/test/metabase/embedding_rest/api/preview_embed_test.clj
index c9e8152b6d7..402c5ec5175 100644
--- a/test/metabase/embedding_rest/api/preview_embed_test.clj
+++ b/test/metabase/embedding_rest/api/preview_embed_test.clj
@@ -537,7 +537,6 @@
(defn random-embedding-secret-key [] (u.random/secure-hex 32))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic *secret-key* nil)
(defn sign [claims] (jwt/sign claims *secret-key*))
diff --git a/test/metabase/events/impl_test.clj b/test/metabase/events/impl_test.clj
index 39693b766c3..5329369025a 100644
--- a/test/metabase/events/impl_test.clj
+++ b/test/metabase/events/impl_test.clj
@@ -5,7 +5,6 @@
[metabase.events.impl :as events]
[methodical.core :as methodical]))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:private ^:dynamic *method-calls* nil)
(events.hierarchy/derive! ::test-topics :metabase/event)
diff --git a/test/metabase/glossary/core_test.clj b/test/metabase/glossary/core_test.clj
index 08b5a33e6a9..50b41838f1f 100644
--- a/test/metabase/glossary/core_test.clj
+++ b/test/metabase/glossary/core_test.clj
@@ -10,7 +10,6 @@
;; `publish-event!` is a methodical multimethod, so capture events with a handler on a test-only parent topic
;; rather than by redefining the var (see the docstring of [[metabase.events.impl/publish-event!]]).
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:private ^:dynamic *events* nil)
(events/derive! ::glossary-test-event :metabase/event)
diff --git a/test/metabase/metabot/tools/shared/content_store_test.clj b/test/metabase/metabot/tools/shared/content_store_test.clj
index 91292d573d0..f8be72cc4ec 100644
--- a/test/metabase/metabot/tools/shared/content_store_test.clj
+++ b/test/metabase/metabot/tools/shared/content_store_test.clj
@@ -49,7 +49,6 @@
(measure-by-id [_ _id] measure-id)
(segment-by-id [_ _id] segment-id)))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic ^:private *stub-can-read?*
"Controls the [[mi/can-read?]] answer for [[stub-row]]s below."
true)
diff --git a/test/metabase/permissions/util_test.clj b/test/metabase/permissions/util_test.clj
index 55da25af6fb..0d556b7e46f 100644
--- a/test/metabase/permissions/util_test.clj
+++ b/test/metabase/permissions/util_test.clj
@@ -189,15 +189,15 @@
"asdf/"
"123"
nil
- ;; these trigger Kondo warnings because the function expects a string or nil, but we should probably test behavior
- ;; anyway for cases where you're passing in a local and Kondo can't infer the type
- #_{:clj-kondo/ignore [:type-mismatch]} {}
+ ;; the function expects a string or nil, but we should probably test behavior anyway for cases where you're
+ ;; passing in a local and Kondo can't infer the type
+ {}
;; the rows below feed intentionally wrong types to exercise runtime validation
- #_{:clj-kondo/ignore [:type-mismatch]} []
- #_{:clj-kondo/ignore [:type-mismatch]} true ;; boolean, not a string or nil
- #_{:clj-kondo/ignore [:type-mismatch]} false ;; boolean, not a string or nil
- #_{:clj-kondo/ignore [:type-mismatch]} (keyword "/asdf/") ;; keyword, not a string or nil
- #_{:clj-kondo/ignore [:type-mismatch]} 1234))) ;; number, not a string or nil
+ []
+ true ;; boolean, not a string or nil
+ false ;; boolean, not a string or nil
+ (keyword "/asdf/") ;; keyword, not a string or nil
+ 1234))) ;; number, not a string or nil
(deftest ^:parallel permission-classify-path
(are [path expected] (= expected
diff --git a/test/metabase/query_processor/date_bucketing_test.clj b/test/metabase/query_processor/date_bucketing_test.clj
index 6c0d8e34773..f1f7770198e 100644
--- a/test/metabase/query_processor/date_bucketing_test.clj
+++ b/test/metabase/query_processor/date_bucketing_test.clj
@@ -1269,7 +1269,6 @@
(u.date/greater-than-period-duration? (u.date/period-duration (:created_at (mt/db)) (t/zoned-date-time))
(t/seconds max-age-seconds)))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:private ^:dynamic *recreate-db-if-stale?* true)
(defn- count-of-grouping! [^TimestampDatasetDef dataset field-grouping & relative-datetime-args]
diff --git a/test/metabase/query_processor/middleware/cache_test.clj b/test/metabase/query_processor/middleware/cache_test.clj
index 43550753212..58056358225 100644
--- a/test/metabase/query_processor/middleware/cache_test.clj
+++ b/test/metabase/query_processor/middleware/cache_test.clj
@@ -52,13 +52,11 @@
(initialize/initialize-if-needed! :db)
(thunk)))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:private ^:dynamic *save-chan*
"Gets a message whenever results are saved to the test backend, or if the reducing function stops serializing results
because of an Exception or if the byte threshold is passed."
nil)
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:private ^:dynamic *purge-chan*
"Gets a message whenever old entries are purged from the test backend."
nil)
@@ -143,10 +141,8 @@
(defmacro with-mock-cache! [[& bindings] & body]
`(do-with-mock-cache! (fn [{:keys [~@bindings]}] ~@body)))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:private ^:dynamic ^Long *query-execution-delay-ms* 10)
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:private ^:dynamic *query-caching-min-ttl*
"Set this to zero to prevent flakes - we don't want a query to slip under the wire here."
0)
@@ -164,7 +160,6 @@
:stages [{:lib/type :mbql.stage/mbql, :source-table 2}]}
query-kvs))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:private ^:dynamic *rows*
"Rows the mock query execution returns. Bind to `[]` to exercise the empty-result path."
[[:toucan 71]
diff --git a/test/metabase/query_processor/middleware/process_userland_query_test.clj b/test/metabase/query_processor/middleware/process_userland_query_test.clj
index b9db966315a..dd883bb132f 100644
--- a/test/metabase/query_processor/middleware/process_userland_query_test.clj
+++ b/test/metabase/query_processor/middleware/process_userland_query_test.clj
@@ -195,7 +195,6 @@
:parameters nil}
(qe))))))))))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:private ^:dynamic *viewlog-call-count* nil)
(methodical/defmethod events/publish-event! ::event
diff --git a/test/metabase/query_processor/streaming_test.clj b/test/metabase/query_processor/streaming_test.clj
index dc1ae9f7f9f..d06d45392cc 100644
--- a/test/metabase/query_processor/streaming_test.clj
+++ b/test/metabase/query_processor/streaming_test.clj
@@ -155,7 +155,6 @@
(compare-results export-format (mt/native-query {:query sql
:params args}))))))))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:private ^:dynamic *number-of-cans* nil)
(deftest ^:parallel preserve-thread-bindings-test
diff --git a/test/metabase/search/api_test.clj b/test/metabase/search/api_test.clj
index f00b1b1fb64..6aad925f23c 100644
--- a/test/metabase/search/api_test.clj
+++ b/test/metabase/search/api_test.clj
@@ -263,7 +263,6 @@
(defmacro ^:private with-search-items-in-collection [created-items-sym search-string & body]
`(do-with-search-items ~search-string false (fn [~created-items-sym] ~@body)))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:private ^:dynamic *search-request-results-database-id*
"Filter out all results from `search-request` that don't have this Database ID. Default: the default H2 `test-data`
Database. Other results are filtered out so these tests can be ran from the REPL without the presence of other
diff --git a/test/metabase/sync/sync_test.clj b/test/metabase/sync/sync_test.clj
index 9a744200725..c1f109f1d9f 100644
--- a/test/metabase/sync/sync_test.clj
+++ b/test/metabase/sync/sync_test.clj
@@ -29,7 +29,6 @@
(driver/register! ::sync-test, :abstract? true)
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic *supports-schemas?*
"Whether the database supports schemas."
true)
@@ -107,7 +106,6 @@
[_ _query]
{:query "SQL string"})
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(defn- ^:dynamic *execute-response*
[query respond]
(mock.util/mock-execute-reducible-query query respond))
diff --git a/test/metabase/test.clj b/test/metabase/test.clj
index dea8d121d14..f67cf72b45d 100644
--- a/test/metabase/test.clj
+++ b/test/metabase/test.clj
@@ -101,8 +101,8 @@
u.random/keep-me)
;; Add more stuff here as needed
-;; re-exported vars keep their deprecated/discouraged status for callers; the facade must require them
-#_{:clj-kondo/ignore [:discouraged-var :deprecated-var]}
+;; re-exported vars keep their deprecated status for callers; the facade must require them
+#_{:clj-kondo/ignore [:deprecated-var]}
(p/import-vars
[actions.test-util
action-executions
diff --git a/test/metabase/test/data/impl.clj b/test/metabase/test/data/impl.clj
index 2ea4b7215f5..b9c14f2cc87 100644
--- a/test/metabase/test/data/impl.clj
+++ b/test/metabase/test/data/impl.clj
@@ -25,7 +25,6 @@
(p/import-vars
[verify verify-data-loaded-correctly])
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic *skip-dataset-prewarm?*
"Whether `with-temp` should skip materializing the test-data Database before opening its transaction.
@@ -52,7 +51,6 @@
([] (get-or-create-default-dataset! (tx/driver)))
([driver] (get-or-create-database! driver (tx/default-dataset driver))))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic ^{:arglists '([])} ^:private *db-fn*
"Implementation of `db` function that should return the current working test database when called, always with no
arguments. By default, this is [[get-or-create-default-dataset!]] for the current [[metabase.driver/*driver*]], which
@@ -103,7 +101,6 @@
(defn- test-data-database-id []
(@memoized-test-data-database-id-fn (tx/driver)))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:private ^:dynamic ^{:arglists '([])} *db-id-fn*
#'test-data-database-id)
@@ -189,7 +186,6 @@
(defn- cached-field-id [table-id parent-id field-name]
(get (field-lookup-map table-id) [parent-id field-name]))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic ^{:added "0.51.0"} *dbdef-used-to-create-db*
"The database definition used to create the currently bound test database. For those rare occasions when you need to
refer back to it."
@@ -392,7 +388,6 @@
prop->old-id)))
database)))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic *db-is-temp-copy?*
"Whether the current test database is a temp copy created with the [[metabase.test/with-temp-copy-of-db]] macro."
false)
diff --git a/test/metabase/test/data/interface.clj b/test/metabase/test/data/interface.clj
index 92f32663826..5e2c0454c39 100644
--- a/test/metabase/test/data/interface.clj
+++ b/test/metabase/test/data/interface.clj
@@ -50,7 +50,6 @@
:type :string
:database-local :only)
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic *use-routing-details*
"Used to decide if routing details should be used for a db."
false)
@@ -214,7 +213,6 @@
(defonce ^:private has-done-before-run (atom #{}))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic *skip-before-run?*
"When true, loading a driver's test extensions does NOT run its [[before-run]] hook. Bound by the nightly sweep
([[metabase.test.data.gc]]), which needs the extensions to dispatch [[gc-orphans!]] but not the hooks: Redshift's
@@ -297,7 +295,6 @@
{:pre [(string? database-name)]}
(str/replace database-name #"\s+" "_"))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic *database-name-override*
"Bind this to a string to override the database name, for the purpose of calculating the qualified table name. The
purpose of this is to allow for a new Database to clone an existing one with the same details (ex: to test different
diff --git a/test/metabase/test/data/one_off_dbs.clj b/test/metabase/test/data/one_off_dbs.clj
index 5dbd61cb49a..f6a00202ef6 100644
--- a/test/metabase/test/data/one_off_dbs.clj
+++ b/test/metabase/test/data/one_off_dbs.clj
@@ -11,7 +11,6 @@
[metabase.test.data :as data]
[toucan2.core :as t2]))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic *conn*
"Bound to a JDBC connection spec when using one of the `with-db` macros below."
nil)
diff --git a/test/metabase/test/redefs.clj b/test/metabase/test/redefs.clj
index 4882385040b..3362bc378c6 100644
--- a/test/metabase/test/redefs.clj
+++ b/test/metabase/test/redefs.clj
@@ -10,7 +10,6 @@
[toucan2.connection :as t2.connection]
[toucan2.tools.with-temp]))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic ^:private *in-with-temp*
"Used to detect whether we're in a nested [[with-temp]]. Default is false."
false)
diff --git a/test/metabase/test/util/dynamic_redefs_test.clj b/test/metabase/test/util/dynamic_redefs_test.clj
index 2dc2b117580..4f4ff69b5b3 100644
--- a/test/metabase/test/util/dynamic_redefs_test.clj
+++ b/test/metabase/test/util/dynamic_redefs_test.clj
@@ -439,7 +439,6 @@
;; Not ^:parallel: `with-redefs` replaces the var's root for every thread.
(deftest ^:synchronized with-redefs-of-reexport-survives-first-redef-of-source-test
;; The global root swap is the case under test.
- #_{:clj-kondo/ignore [:metabase/prefer-with-dynamic-fn-redefs]}
(with-redefs [reexport-6 (constantly :stub)]
(testing "a `with-redefs` stub on a re-export that was never proxied outlasts the first dynamic redef of its source"
(mt/with-dynamic-fn-redefs [source-6 (constantly :source)]
@@ -456,7 +455,6 @@
;; Not ^:parallel: `with-redefs` replaces the var's root for every thread.
(deftest ^:synchronized reexport-first-redefined-inside-with-redefs-test
;; The global root swap is the case under test.
- #_{:clj-kondo/ignore [:metabase/prefer-with-dynamic-fn-redefs]}
(with-redefs [reexport-7 (constantly :stub)]
(testing "the first dynamic redef of a re-export, inside a `with-redefs` of it"
(mt/with-dynamic-fn-redefs [reexport-7 (constantly :reexport)]
diff --git a/test/metabase/warehouses/models/database_test.clj b/test/metabase/warehouses/models/database_test.clj
index 57b4a2472b6..9c90db6599d 100644
--- a/test/metabase/warehouses/models/database_test.clj
+++ b/test/metabase/warehouses/models/database_test.clj
@@ -79,7 +79,6 @@
delete-queries (atom [])]
;; A dynamic redef permanently proxies this hot var. This test is synchronized, so a temporary root swap is
;; both safe and cheaper for the rest of the test JVM.
- #_{:clj-kondo/ignore [:metabase/prefer-with-dynamic-fn-redefs]}
(with-redefs [t2/query-one (fn [& args]
(swap! delete-queries into (filter :delete-from args))
(apply original-query-one args))]
@@ -94,6 +93,7 @@
:model/Field _ {:table_id table-id :parent_id parent-id}]
(t2/with-call-count [call-count]
;; This only deletes the test-local Database Fields created above.
+ ;; [kondo-keep] suppresses a warning :redundant-ignore can't see; --audit rechecks
#_{:clj-kondo/ignore [:metabase/validate-deftest]}
(#'database/delete-database-fields! db-id)
(is (= 4 (call-count))
@@ -420,7 +420,6 @@
(is (= driver.u/default-sensitive-fields
(database/sensitive-fields-for-db {})))))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:private ^:dynamic *secret-can-connect?* (constantly true))
(defmethod driver/can-connect? :secret-test-driver [& args] (apply *secret-can-connect?* args))
diff --git a/test/metabase/xrays/related_test.clj b/test/metabase/xrays/related_test.clj
index 34c8d1675bb..868da09349b 100644
--- a/test/metabase/xrays/related_test.clj
+++ b/test/metabase/xrays/related_test.clj
@@ -72,7 +72,6 @@
(is (= ["similar" "broken"]
(map :name (#'related/rank-by-similarity reference [broken similar]))))))))
-#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:private ^:dynamic *world* {})
(defn- do-with-world [f]