Skip to content

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

103 KB
Raw Blame
;; -*- comment-column: 100; -*-
{:config-paths ["macros" "src" "config"]
 :linters
 {;;
  ;; enabled optional linters (these are disabled by default)
  ;;

  :aliased-namespace-symbol     {:level :warning}
  :case-symbol-test             {:level :warning}
  :def-fn                       {:level :warning}
  :dynamic-var-not-earmuffed    {:level :warning}
  :equals-expected-position     {:level :warning, :only-in-test-assertion true}
  :equals-true                  {:level :warning}
  :keyword-binding              {:level :warning}
  :main-without-gen-class       {:level :warning}
  :minus-one                    {:level :warning}
  :misplaced-docstring          {:level :warning}
  :missing-body-in-when         {:level :warning}
  :missing-docstring            {:level :warning}
  :missing-else-branch          {:level :warning}
  :namespace-name-mismatch      {:level :warning}
  :non-arg-vec-return-type-hint {:level :warning}
  :plus-one                     {:level :warning}
  :reduce-without-init          {:level :warning}
  :redundant-call               {:level :warning}
  :redundant-fn-wrapper         {:level :warning}
  :redundant-str-call           {:level :warning}
  :self-requiring-namespace     {:level :warning}
  :single-key-in                {:level :warning}
  :unsorted-imports             {:level :warning}
  :unsorted-required-namespaces {:level :warning}
  :unused-alias                 {:level :warning}
  :use                          {:level :warning}
  :warn-on-reflection           {:level :warning}

  ;;
  ;; other disabled-by-default linters it would be nice to enable soon
  ;;

  ;; TODO (cam): most of these either have a ton of things that need to be fixed or cause issues
  ;; with [[metabase.util.match/match]] and friends -- we need to write a custom hook for those macros so Kondo
  ;; can understand them.

  #_:docstring-leading-trailing-whitespace
  #_:equals-false
  #_:used-underscored-binding

  ;;
  ;; disabled linters
  ;;

  :constant-condition {:level :off} ; TODO (sashko): too confused by defenterprises, some hook/config is needed
  :redundant-ignore {:level :off} ; lots of false positives, see https://github.com/clj-kondo/clj-kondo/issues/2414
  :unexpected-recur {:level :off} ; TODO (cam): I think we just need to tell it how to handle MBQL match and we can enable this?
  :redundant-primitive-coercion {:level :off} ; there are many defensive boolean coercions, kondo looks too much into it
  :type-mismatch {:level :off} ; Still quite raw, can sometimes give useful insights, but sometimes is just confused

  ;;
  ;; globally-enabled custom linters
  ;;
  :metabase/check-defmulti-arglists                          {:level :warning}
  :metabase/check-def-check-not-uppercase-name               {:level :warning}
  :metabase/check-def-no-underscores                         {:level :warning}
  :metabase/check-me-humanize                                {:level :warning}
  :metabase/check-testing-not-empty                          {:level :warning}
  :metabase/defsetting-must-specify-export                   {:level :warning}
  :metabase/defsetting-namespace                             {:level :warning}
  :metabase/discourage-dynamic-vars                          {:level :warning}
  :metabase/discourage-millis-duration                       {:level :warning}
  :metabase/mbql-query-first-arg                             {:level :warning}
  :metabase/missing-test-expr-requires-in-cljs               {:level :warning}
  :metabase/modules                                          {:level :warning} ; more config in `.clj-kondo/config/modules/config.edn`
  :metabase/namespace-name                                   {:level :warning}
  :metabase/no-jsqlparser-imports                            {:level :warning}
  :metabase/prefer-with-dynamic-fn-redefs                    {:level :warning}
  :metabase/t2-query-namespace                               {:level :warning}
  :metabase/t2-implicit-pk                                   {:level :warning}
  ;; App-DB query hygiene: a value reaching a value slot unmarked, and a query written as
  ;; `:column value` pairs rather than a map. Off by default and enabled per namespace under
  ;; `:config-in-ns`; flip it on globally once every `db.clj` has been converted.
  :metabase/unsafe-app-db-query                              {:level :off}
  :metabase/toucan-model-ns                                  {:level :warning}
  :metabase/require-shape-checker                            {:level :warning}
  :metabase/tests-must-live-in-known-modules                 {:level :warning}
  :metabase/validate-defendpoint-route-uses-kebab-case       {:level :warning}
  :metabase/validate-defendpoint-query-params-use-kebab-case {:level :warning}
  :metabase/validate-logging                                 {:level :warning}
  :metabase/validate-mb-app-db-migrations-test               {:level :warning}
  :metabase/validate-mb-driver-tests                         {:level :warning}
  :metabase/validate-mb-once                                 {:level :warning}

  :metabase/validate-deftest
  {:level :warning

   ;; calling these functions will result in an error in tests marked `^:parallel`
   ;;
   ;; TODO -- these should all be made thread safe if possible or renamed so they end in `!`. Then we can remove them
   ;; from this list because by default anything ending in `!` is considered to be thread-unsafe
   ;;
   ;; TODO (Cam 6/19/25) -- move this into the `test-helpers/config.edn` file so they can live with their friends.
   :parallel/unsafe
   #{java.util.Locale/setDefault
     java.lang.System/setProperty
     java.lang.System/setProperties
     clojure.core/alter-var-root
     clojure.core/with-redefs
     clojure.core/with-redefs-fn
     metabase.actions.test-util/with-actions
     metabase.actions.test-util/with-actions-disabled
     metabase.actions.test-util/with-actions-enabled
     metabase.actions.test-util/with-actions-test-data
     metabase.actions.test-util/with-actions-test-data-and-actions-enabled
     metabase.actions.test-util/with-actions-test-data-tables
     metabase.analytics.snowplow-test/with-fake-snowplow-collector
     metabase.channel.email-test/with-expected-messages
     metabase.channel.email-test/with-fake-inbox
     metabase.test.data.users/with-group
     metabase.test.data.users/with-group-for-user
     metabase.test.data/with-empty-h2-app-db
     metabase.test.util.log/with-log-level
     metabase.test.util/with-all-users-permission
     metabase.test.util/with-discarded-collections-perms-changes
     metabase.test.util/with-env-keys-renamed-by
     metabase.test.util/with-model-cleanup
     metabase.test.util/with-non-admin-groups-no-root-collection-for-namespace-perms
     metabase.test.util/with-non-admin-groups-no-root-collection-perms
     metabase.test.util/with-temp-env-var-value
     metabase.test.util/with-temp-vals-in-db
     metabase.test.util/with-temporary-raw-setting-values
     metabase.test.util/with-temporary-setting-values
     metabase.test.util/with-user-in-groups
     metabase.test/with-actions
     metabase.test/with-actions-disabled
     metabase.test/with-actions-enabled
     metabase.test/with-actions-test-data
     metabase.test/with-actions-test-data-and-actions-enabled
     metabase.test/with-actions-test-data-tables
     metabase.test/with-all-users-permission
     metabase.test/with-discarded-collections-perms-changes
     metabase.test/with-empty-h2-app-db
     metabase.test/with-env-keys-renamed-by
     metabase.test/with-expected-messages
     metabase.test/with-fake-inbox
     metabase.test/with-group
     metabase.test/with-group-for-user
     metabase.test/with-log-level
     metabase.test/with-model-cleanup
     metabase.test/with-non-admin-groups-no-root-collection-for-namespace-perms
     metabase.test/with-non-admin-groups-no-root-collection-perms
     metabase.test/with-temp-env-var-value
     metabase.test/with-temp-vals-in-db
     metabase.test/with-temporary-raw-setting-values
     metabase.test/with-temporary-setting-values
     metabase.test/with-user-in-groups}

   ;; these functions are allowed in `^:parallel` tests even tho they end in `!`
   :parallel/safe
   #{clojure.core/assoc!
     clojure.core/compare-and-set!
     clojure.core/conj!
     clojure.core/disj!
     clojure.core/dissoc!
     clojure.core/persistent!
     clojure.core/pop!
     clojure.core/reset!
     clojure.core/reset-vals!
     clojure.core/run!
     clojure.core/swap!
     clojure.core/swap-vals!
     clojure.core/volatile!
     clojure.core/vreset!
     clojure.core/vswap!
     clojure.core.async/<!
     clojure.core.async/<!!
     clojure.core.async/>!
     clojure.core.async/>!!
     clojure.core.async/alt!
     clojure.core.async/alt!!
     clojure.core.async/alts!
     clojure.core.async/alts!!
     clojure.core.async/close!
     clojure.core.async/ioc-alts!
     clojure.core.async/offer!
     clojure.core.async/onto-chan!
     clojure.core.async/onto-chan!!
     clojure.core.async/poll!
     clojure.core.async/put!
     clojure.core.async/take!
     clojure.core.async/to-chan!
     clojure.core.async/to-chan!!
     ;; writes the ratchet files from a :once fixture that finishes before the parallel tests
     dev.kondo-ratchet/fix!
     ;; builds Babashka's classpath cache from a :once fixture, before the parallel tests start, so that
     ;; they don't each race to create it; the side effect is process-external and idempotent
     metabase.core.modules-consistency-test/warm-babashka-classpath!
     metabase.ai-tracing.core/record!
     metabase.api.macros.defendpoint.tools-manifest/assert-optional-fields-nullable!
     ;; MCP v2 tool tests: call-tool! dispatches a tool with no shared mutable state across tests
     metabase.mcp.v2.tools.alert-test/call-tool!
     metabase.mcp.v2.tools.definitions-test/call-tool!
     metabase.mcp.v2.tools.metric-test/call-tool!
     ;; the `!` is for the throw (a teaching error), not a mutation; no shared mutable state
     metabase.mcp.v2.tools.browse/validate-args-for-action!
     ;; Metabot tool errors: the `!` is for the throw, not a mutation. A recoverable constructor and
     ;; `unrecoverable!` only build an ex-info and raise it, and `validate-tool!` only inspects a
     ;; declaration. `declare-recoverable!` is deliberately absent — it writes the global catalog.
     metabase.metabot.tools.core/validate-tool!
     metabase.metabot.tools.error/throw-recoverable!
     metabase.metabot.tools.error/unrecoverable!
     metabase.metabot.tools.error-test/test-custom-status!
     metabase.metabot.tools.error-test/test-no-widget!
     metabase.metabot.tools.recoverable.pipeline-test/pipeline-error-text!
     metabase.metabot.tools.recoverable.pipeline-test/text-for!
     metabase.metabot.tools.recoverable.pipeline-test/two-surface-error!
     metabase.metabot.tools.recoverable.pipeline/unknown-table!
     metabase.channel.core/send!
     metabase.channel.render.pdf/draw-too-large!
     metabase.channel.render.pdf/draw-no-results!
     metabase.channel.render.pdf/render-card-cell!
     metabase.channel.render.pdf.font/load-fonts!
     metabase.warehouses.models.database/assert-not-h2!
     metabase.driver.sql-jdbc.execute/execute-prepared-statement!
     ;; only inspects a details map and throws; the `!` is for the throw, not for a mutation
     metabase.driver/validate-db-details!
     metabase.driver.util/validate-connection-parameters!
     metabase.mcp.usage/record-mcp-session!
     metabase.mcp.usage/record-mcp-session-end!
     metabase.mcp.usage/record-mcp-tool-call!
     metabase.notification.models/create-notification!
     metabase.oauth-server.core/reset-provider!
     metabase.pulse.send/send-pulse!
     metabase-enterprise.transforms-python.python-runner-test/execute!
     ;; MCP usage tests isolate their rows by unique keys (session id / tool name / duration /
     ;; client version) and clean up only those, so these deletes are safe in parallel.
     metabase-enterprise.mcp.usage-test/cleanup!
     metabase-enterprise.mcp.usage-test/cleanup-calls!
     ;; Workspace isolation functions are safe in parallel tests because they operate on
     ;; isolated, test-specific workspaces and databases that don't affect other tests
     metabase-enterprise.workspaces.isolation/destroy-workspace-isolation!
     metabase.lib-metric.ast.plan/validate-arithmetic-ast!
     metabase-enterprise.workspaces.isolation/ensure-database-isolation!
     metabase-enterprise.workspaces.test-util/create-ready-ws!
     metabase-enterprise.workspaces.core/clear-instance-workspace!
     metabase-enterprise.workspaces.core/set-instance-workspace!
     metabase.workspaces.core/clear-instance-workspace!
     metabase.workspaces.core/set-instance-workspace!
     ;; Safe in tests, where we typically use a private, temporary index per thread.
     metabase.search.core/reindex!
     metabase.util/run-count!
     next.jdbc/execute!
     ;; pure validator: parses a keyword and throws on a bad one, touches no state
     metabase.mcp.v2.tools.question/check-semantic-type!
     ;; pure validator: throws unless its argument is a map or nil, touches no state
     metabase.util.honey-sql-2/assert-map-or-nil!}}

  :metabase/i-like-making-cams-eyes-bleed-with-horrifically-long-tests
  {:level      :warning
   :max-length 150}

  ;; Warn on long tests (tests over `:min-length`) that look like
  ;;
  ;;    (deftest my-test
  ;;      (testing ...)
  ;;      (testing ...)
  ;;      (testing ...))
  :metabase/validate-deftest-logically-separate-tests
  {:level      :warning
   :min-length 60}

  ;; this is not enabled here, it is enabled below only for specific namespaces.
  :metabase/disallow-hardcoded-driver-names-in-tests
  ;; don't include `:h2` since that will probably lead to a mountain of tests where we are specifically testing
  ;; middleware or compilation behavior with just H2 since it's the default.
  {:drivers #{;; core drivers
              #_:h2
              :postgres
              :mysql
              ;; module drivers
              :athena
              :bigquery-cloud-sdk
              :clickhouse
              :databricks
              :druid
              :druid-jdbc
              :googleanalytics
              :hive-like
              :mongo
              :oracle
              :presto-jdbc
              :redshift
              :snowflake
              :sparksql
              :sqlite
              :sqlserver
              :starburst
              :vertica}}

  ;;
  ;; misc config for built-in linters
  ;;

  :refer-all           {:level :warning, :exclude [clojure.test]}
  :unused-referred-var {:exclude {compojure.core [GET DELETE POST PUT]}}

  ;; TODO -- all of these entries are HACKS and we should fix them by writing real custom Kondo HOOKS for these
  ;; macros. Please don't add anything new to this list! Talk to your best bud Cam if you don't know how to write a
  ;; Kondo hook and he will pair with you on it. Thanks! -- Cam
  :unresolved-symbol
  {:exclude
   [(build.uberjar/with-duration-ms)
    (cljs.test/is [=? malli=])
    (clojure.test/is [=? malli= qv=])
    (clojure.tools.macro/macrolet)
    instaparse.core/transform
    (metabase.server.streaming-response/streaming-response)
    (metabase.driver.druid.query-processor-test/druid-query-returning-rows)
    (metabase.driver-api.core/match-one)
    (metabase.driver-api.core/match-many)
    (metabase.driver-api.core/replace)
    (metabase.driver-api.core/replace-in)
    (metabase.query-processor.middleware.cache-backend.interface/with-cached-results)
    (metabase.util.regex/rx [opt])
    (metabase.util/prog1 [<>])]}

  ;; TODO (Cam 8/22/25) -- what's the point of marking stuff deprecated if we don't have Kondo enforce it? We should
  ;; remove all of these and add individual ignores as needed.
  :deprecated-var
  {:exclude
   {metabase.driver.sql-jdbc.execute.old-impl/set-timezone-sql   {:namespaces ["metabase\\.driver.*"]}
    metabase.driver.sql-jdbc.execute/set-time-zone-if-supported! {:namespaces ["metabase\\.driver.*"]}
    metabase.driver/current-db-time                              {:namespaces ["metabase.*"]}
    metabase.driver/supports?                                    {:namespaces ["metabase.*"]}
    metabase.query-processor.util/normalize-token                {:namespaces ["metabase.*"]}}}

  :discouraged-var
  {metabase-enterprise.search.entity-retrieval.core/search-unfiltered        {:message "Permission bypass risk: library-index hits are unfiltered — resolve each entity and drop what the current user can't read"}
   metabase.search.entity-retrieval.core/search-unfiltered                   {:message "Permission bypass risk: library-index hits are unfiltered — resolve each entity and drop what the current user can't read"}
   metabase.search.entity-retrieval.mirror/search-unfiltered                 {:message "Permission bypass risk: library-index hits are unfiltered — resolve each entity and drop what the current user can't read"}
   metabase-enterprise.transform-testing.expectations.equals/->EqualsRows    {:message "Build an expectation with metabase-enterprise.transform-testing.expectations.protocol/build, over a value the schema has passed — the generated constructors skip validation"}
   metabase-enterprise.transform-testing.expectations.equals/map->EqualsRows {:message "Build an expectation with metabase-enterprise.transform-testing.expectations.protocol/build, over a value the schema has passed — the generated constructors skip validation"}
   metabase-enterprise.transform-testing.expectations.equals/->EqualsSql     {:message "Build an expectation with metabase-enterprise.transform-testing.expectations.protocol/build, over a value the schema has passed — the generated constructors skip validation"}
   metabase-enterprise.transform-testing.expectations.equals/map->EqualsSql  {:message "Build an expectation with metabase-enterprise.transform-testing.expectations.protocol/build, over a value the schema has passed — the generated constructors skip validation"}
   metabase-enterprise.transform-testing.expectations.empty/->Empty          {:message "Build an expectation with metabase-enterprise.transform-testing.expectations.protocol/build, over a value the schema has passed — the generated constructors skip validation"}
   metabase-enterprise.transform-testing.expectations.empty/map->Empty       {:message "Build an expectation with metabase-enterprise.transform-testing.expectations.protocol/build, over a value the schema has passed — the generated constructors skip validation"}
   clojure.core/print                                 {:message "Use metabase.util.log instead of clojure.core/print"}
   clojure.core/println                               {:message "Use metabase.util.log instead of clojure.core/println"}
   clojure.core/printf                                {:message "Use metabase.util.log instead of clojure.core/printf"}
   clojure.core/prn                                   {:message "Use metabase.util.log instead of clojure.core/prn"}
   clojure.core/pr                                    {:message "Use metabase.util.log instead of clojure.core/pr"}
   clojure.core/tap>                                  {:message "Don't use tap> is source code"}
   clojure.core/time                                  {:message "Don't use time in source code"}
   clojure.test.check/quick-check                     {:message "You probably meant to use clojure.test.check.clojure-test/defspec instead -- quick check will run the tests when it is evaluated rather than when we run the test suite."}
   clojure.java.jdbc/get-connection                   {:message "Use sql-jdbc.execute/do-with-connection-with-options (for drivers) or t2/with-connection (for the app DB) instead of jdbc/get-connection"}
   clojure.java.jdbc/with-db-connection               {:message "Use sql-jdbc.execute/do-with-connection-with-options (for drivers) or t2/with-connection (for the app DB) instead of jdbc/with-db-connection"}
   clojure.java.jdbc/with-db-metadata                 {:message "Use sql-jdbc.execute/do-with-connection-with-options + .getMetaData instead of jdbc/with-db-metadata"}
   clojure.pprint/pprint                              {:message "Use metabase.util.log instead of clojure.pprint/pprint"}
   clojure.pprint/print-table                         {:message "Use metabase.util.log instead of printing directly to the console"}
   clojure.string/lower-case                          {:message "Use metabase.util/lower-case-en instead of clojure.string/lower-case"}
   clojure.string/upper-case                          {:message "Use metabase.util/upper-case-en instead of clojure.string/upper-case"}
   compojure.core/context                             {:message "Use metabase.api.util.handlers/route-map-handler instead of compojure.core/context, it is much faster and supports OpenAPI spec generation"}
   compojure.core/defroutes                           {:message "Use metabase.api.util.handlers/defroutes instead of compojure.core/routes, it supports OpenAPI spec generation."}
   compojure.core/routes                              {:message "Use metabase.api.util.handlers/routes instead of compojure.core/routes, it supports OpenAPI spec generation."}
   clojurewerkz.quartzite.jobs/defjob                 {:message "Use metabase.task/defjob instead of clojurewerkz.quartzite.jobs/defjob"}
   fipp.edn/pprint                                    {:message "Use metabase.util.log instead of fipp.edn/pprint"}
   honeysql.core/call                                 {:message "Use hx/call instead because it is Honey SQL 2 friendly"}
   honeysql.core/raw                                  {:message "Use hx/raw instead because it is Honey SQL 2 friendly"}
   java-time/with-clock                               {:message "Use mt/with-clock"}
   java.util.UUID/randomUUID                          {:message "Use clojure.core/random-uuid instead of java.util.UUID/randomUUID"}
   malli.core/explain                                 {:message "Use metabase.util.malli.registry/explain instead of malli.core/explain because it has built-in caching"}
   malli.core/explainer                               {:message "Use metabase.util.malli.registry/explainer instead of malli.core/explainer because it has built-in caching"}
   malli.core/validate                                {:message "Use metabase.util.malli.registry/validate instead of malli.core/validate because it has built-in caching"}
   malli.core/validator                               {:message "Use metabase.util.malli.registry/validator instead of malli.core/validator because it has built-in caching"}
   me.flowthing.pp/pprint                             {:message "Use metabase.util.log instead of me.flowthing.pp/pprint"}
   medley.core/random-uuid                            {:message "Use clojure.core/random-uuid instead of medley.core/random-uuid"}
   metabase.driver/database-supports?                 {:message "Use metabase.driver.util/supports? instead of metabase.driver/database-supports?"}
   metabase.lib.convert/->legacy-MBQL                 {:message "Conversion to legacy MBQL is discouraged, please use Lib to manipulate MBQL queries"}
   metabase.lib.core/->legacy-MBQL                    {:message "Conversion to legacy MBQL is discouraged, please use Lib to manipulate MBQL queries"}
   metabase.lib.equality/find-column-indexes-for-refs {:message "Use lib.equality/closest-matches-in-metadata or lib.equality/find-closest-matches-for-refs instead of lib.equality/find-column-indexes-for-refs"}
   metabase-enterprise.transforms.interface/execute!  {:message "Use metabase-enterprise.transforms.execute/execute! instead of metabase-enterprise.transforms.interface/execute!"}
   next.jdbc/active-tx?                               {:message "Use metabase.app-db.core/in-transaction? to see if we are in a transaction"}
   toucan2.core/debug                                 {:message "Don't commit code using t2/debug"}
   toucan2.tools.debug/debug                          {:message "Don't commit code using t2/debug"}}

  :discouraged-namespace
  {camel-snake-kebab.core {:message "CSK is not Turkish-safe, use the versions in metabase.util instead."}
   cheshire.core          {:message "Use metabase.util.json instead of cheshire.core directly."}
   clj-time.core          {:message "Use java-time.api or metabase.util.date-2 instead of clj-time"}
   clojure.tools.logging  {:message "Use metabase.util.log instead of clojure.tools.logging directly"}
   grouper.core           {:message "Use metabase.util.grouper instead of grouper.core"}
   honeysql.core          {:message "Use Honey SQL 2. Honey SQL 1 is removed as a dependency in Metabase 49+."}
   honeysql.format        {:message "Use Honey SQL 2. Honey SQL 1 is removed as a dependency in Metabase 49+."}
   honeysql.helpers       {:message "Use Honey SQL 2. Honey SQL 1 is removed as a dependency in Metabase 49+."}
   honeysql.types         {:message "Use Honey SQL 2. Honey SQL 1 is removed as a dependency in Metabase 49+."}
   honeysql.util          {:message "Use Honey SQL 2. Honey SQL 1 is removed as a dependency in Metabase 49+."}}

  :discouraged-tag {p {:message "You can use it, but don't commit it."}}

  :unresolved-var
  {:exclude
   [colorize.core]}

  :consistent-alias
  {:aliases
   {buddy.core.hash                           buddy-hash
    cheshire.generate                         json.generate
    clj-http.client                           http
    clj-ldap.client                           ldap
    clj-time.coerce                           time.coerce
    clj-time.format                           time.format
    clojure.core.async                        a
    clojure.data                              data
    clojure.math.combinatorics                math.combo
    clojure.pprint                            pprint
    clojure.spec.alpha                        s
    clojure.string                            str
    clojure.test                              t
    clojure.tools.build.api                   b
    clojure.tools.logging                     log
    clojure.tools.namespace.dependency        ns.deps
    clojure.tools.namespace.find              ns.find
    clojure.tools.namespace.parse             ns.parse
    colorize.core                             colorize
    environ.core                              env
    hiccup.core                               hiccup
    hiccup.util                               hiccup.util
    honey.sql                                 sql
    honey.sql.helpers                         sql.helpers
    java-time.api                             t
    macaw.core                                macaw
    malli.core                                mc
    malli.error                               me
    malli.experimental                        mx
    malli.generator                           mg
    malli.provider                            mp
    malli.transform                           mtx
    malli.util                                mut
    medley.core                               m
    metabase-enterprise.database-routing.core database-routing
    metabase.analyze.classifiers.core         classifiers
    metabase.channel.core                     channel
    metabase.channel.render.core              channel.render
    metabase.channel.render.markdown          markdown
    metabase.cloud-migration.core             cloud-migration
    metabase.eid-translation.core             eid-translation
    metabase.llm.test-util                    llm.tu
    metabase.login-history.core               login-history
    metabase.model-persistence.core           model-persistence
    metabase.notification.core                notification
    metabase.notification.payload.core        notification.payload
    metabase.permissions.core                 perms
    metabase.premium-features.core            premium-features
    metabase.public-sharing.core              public-sharing
    metabase.pulse.core                       pulse
    metabase.query-permissions.core           query-perms
    metabase.request.core                     request
    metabase.revisions.core                   revisions
    metabase.server.core                      server
    metabase.settings.core                    setting
    metabase.sso.core                         sso
    metabase.timeline.core                    timeline
    metabase.util.cron                        u.cron
    metabase.util.currency                    currency
    metabase.util.date-2                      u.date
    metabase.util.date-2.common               u.date.common
    metabase.util.date-2.parse                u.date.parse
    metabase.util.embed                       embed
    metabase.util.encryption                  encryption
    metabase.util.encryption-test             encryption-test
    metabase.util.files                       u.files
    metabase.util.grouper                     grouper
    metabase.util.honey-sql-2                 h2x
    metabase.util.i18n                        i18n
    metabase.util.i18n.impl                   i18n.impl
    metabase.util.jvm                         u.jvm
    metabase.util.log                         log
    metabase.util.macros                      u.macros
    metabase.util.malli                       mu
    metabase.util.malli.schema                ms
    metabase.util.password                    u.password
    metabase.util.ui-logic                    ui-logic
    metabase.xrays.core                       xrays
    monger.collection                         mcoll
    ring.mock.request                         ring.mock
    ring.util.codec                           codec
    ring.util.response                        response
    saml20-clj.core                           saml
    metabase.transforms-base.util              transforms-base.u
    metabase.transforms.util                   transforms.u
    toucan2.core                              t2}}}

 :lint-as
 {cljs.cache/defcache                                                                   clojure.core/deftype
  clojure.core.cache/defcache                                                           clojure.core/deftype
  clojure.test.check.clojure-test/defspec                                               clojure.test/deftest
  clojure.test.check.properties/for-all                                                 clojure.core/let
  clojurewerkz.quartzite.jobs/defjob                                                    clojure.core/defn
  com.climate.claypoole/with-shutdown!                                                  clojure.core/let
  instaparse.core/defparser                                                             clojure.core/def
  metabase-enterprise.action-v2.test-util/with-test-tables!                             clojure.core/let
  metabase-enterprise.content-translation.routes-test/with-new-secret-key!              clojure.core/fn
  metabase-enterprise.mfa.enrollment-flow-test/with-fresh-user-session!                  clojure.core/fn
  metabase-enterprise.mfa.login-flow-test/with-enrolled-rasta!                           clojure.core/fn
  metabase-enterprise.mfa.recovery-codes-test/with-confirmed-enrollment!                 clojure.core/fn
  metabase-enterprise.search.entity-retrieval.reconcile-test/with-isolated-index        clojure.core/fn
  metabase-enterprise.serialization.metadata-file-import.wire-format-test/with-tiny-fixture! clojure.core/fn
  metabase-enterprise.serialization.test-util/with-dbs                                  clojure.core/fn
  metabase-enterprise.serialization.test-util/with-random-dump-dir                      clojure.core/let
  metabase-enterprise.tenants.pulse-api-test/with-tenant-pulse-fixture!                 clojure.core/fn
  metabase-enterprise.workspaces.test-util/with-resources!                              clojure.core/let
  metabase-enterprise.workspaces.test-util/with-workspaces!                             clojure.core/let
  metabase.actions.test-util/with-actions                                               clojure.core/let
  metabase.transforms.test-util/with-transform-cleanup!                                 clojure.core/let
  metabase.transforms.test-util/with-transforms-api-users!                              clojure.core/fn
  metabase.api.common/let-404                                                           clojure.core/let
  metabase.app-db.connection/with-unshared-connection                                   clojure.core/fn
  metabase.app-db.core/with-unshared-connection                                         clojure.core/fn
  metabase.app-db.custom-migrations.util/with-temp-scheduler!                           clojure.core/fn
  metabase.app-db.custom-migrations/define-migration                                    clj-kondo.lint-as/def-catch-all
  metabase.app-db.custom-migrations/define-reversible-migration                         clj-kondo.lint-as/def-catch-all
  metabase.app-db.liquibase/with-liquibase                                              clojure.core/let
  metabase.app-db.schema-migrations-test.impl/with-temp-empty-app-db                    clojure.core/let
  metabase.channel.impl.http-test/with-captured-http-requests                           clojure.core/fn
  metabase.channel.impl.http-test/with-server                                           clojure.core/let
  metabase.collections.models.collection-test/with-collection-in-location               clojure.core/let
  metabase.collections.test-utils/with-library                                          clojure.core/fn
  metabase.driver.mongo.connection/with-mongo-client                                    clojure.core/let
  metabase.driver.mongo.connection/with-mongo-database                                  clojure.core/let
  metabase.driver.mongo.query-processor/mongo-let                                       clojure.core/let
  metabase.driver.sql-jdbc.actions/with-jdbc-transaction                                clojure.core/let
  metabase.driver.sql-jdbc.connection.ssh-tunnel/with-ssh-tunnel                        clojure.core/let
  metabase.driver.sql-jdbc.connection/with-connection-spec-for-testing-connection       clojure.core/let
  metabase.driver.sql-jdbc.execute.diagnostic/capturing-diagnostic-info                 clojure.core/fn
  metabase.driver-api.core/defsetting                                                   hooks.metabase.settings.models.setting/defsetting
  metabase.mcp.v2.registry/deftool                                                      clojure.core/defn
  metabase.metabot.tools.core/defrecoverable                                            clojure.core/defn
  metabase.metabot.tools.error/defrecoverable                                           clojure.core/defn
  metabase.metabot.tools.recoverable.pipeline/defpipeline-error                         clojure.core/def
  metabase.models.json-migration/def-json-migration                                     clj-kondo.lint-as/def-catch-all
  metabase.models.util.spec-update/define-spec                                          clojure.core/def
  metabase.notification.test-util/with-card-notification                                clojure.core/let
  metabase.notification.test-util/with-system-event-notification!                       clojure.core/let
  metabase.notification.test-util/with-temp-notification                                clojure.core/let
  metabase.oauth-server.test-util/with-oauth-client                                     clojure.core/fn
  metabase.osi.ai-context.api-test/with-test-entry                                      clojure.core/let
  metabase.premium-features.core/defenterprise-schema                                   clj-kondo.lint-as/def-catch-all
  metabase.premium-features.defenterprise/defenterprise-schema                          clj-kondo.lint-as/def-catch-all
  metabase.premium-features.settings/define-premium-feature                             clojure.core/def
  metabase.pulse.dashboard-subscription-test/with-dashboard-sub-for-card                clojure.core/let
  metabase.pulse.send-test/with-pulse-for-card                                          clojure.core/let
  metabase.query-processor.pipeline-queries-test/mbql5-query                            clojure.core/->
  metabase.query-processor.pipeline-queries-test/run-mbql5-query                        clojure.core/->
  metabase.query-processor.error-type/deferror                                          clojure.core/def
  metabase.query-processor.core/with-reducible-deserialized-results                     clojure.core/let
  metabase.query-processor.middleware.cache.impl/with-reducible-deserialized-results    clojure.core/let
  metabase.query-processor.result-serialization/with-reducible-deserialized-results     clojure.core/let
  metabase.query-processor.middleware.process-userland-query-test/with-query-execution! clojure.core/let
  metabase.query-processor.setup/with-qp-setup                                          clojure.core/let
  metabase.search.api-test/do-test-users                                                clojure.core/let
  metabase.settings.core/define-multi-setting                                           clojure.core/def
  metabase.api-scope.core/defscope                                                      clj-kondo.lint-as/def-catch-all
  metabase.settings.core/defsetting                                                     clj-kondo.lint-as/def-catch-all
  metabase.settings.models.setting.multi-setting/define-multi-setting                   clojure.core/def
  metabase.settings.models.setting/defsetting                                           clj-kondo.lint-as/def-catch-all
  metabase.server.test-util/with-test-server                                             clojure.core/let
  metabase.sso.ldap/with-ldap-connection                                                clojure.core/fn
  metabase.sync.util/sum-for                                                            clojure.core/for
  metabase.sync.util/with-emoji-progress-bar                                            clojure.core/let
  metabase.task.core/defjob                                                             clojure.core/defn
  metabase.task.impl/defjob                                                             clojure.core/defn
  metabase.test.data.interface/defdataset                                               clojure.core/def
  metabase.test.data.interface/defdataset-edn                                           clojure.core/def
  metabase.test.embedded-postgres.core/with-system                                      clojure.core/let
  metabase.test.util.dynamic-redefs/in-scope                                            clojure.core/let
  metabase.test/defdataset                                                              clojure.core/def
  metabase.test/let-url                                                                 clojure.core/let
  metabase.test/with-actions                                                            clojure.core/let
  metabase.test/with-grouper-batches!                                                   clojure.core/fn
  metabase.test/with-open-channels                                                      clojure.core/let
  metabase.test/with-single-admin-user!                                                 clojure.core/fn
  metabase.test/with-temp-dir                                                           clojure.core/let
  metabase.test/with-temp-empty-app-db                                                  clojure.core/let
  metabase.test/with-temp-file                                                          clojure.core/let
  metabase.test/with-user-in-groups                                                     clojure.core/let
  metabase.transforms-rest.api.transform-runs-test/with-runs-fixture!                   clojure.core/fn
  metabase.upload.impl-test/with-upload-table!                                          clojure.core/let
  metabase.util/for-map                                                                 clojure.core/for
  metabase.util.files/with-open-path-to-resource                                        clojure.core/let
  metabase.util.malli.defn/defn                                                         schema.core/defn
  metabase.util.malli.defn/defn-                                                        schema.core/defn
  metabase.util.malli.fn/fn                                                             schema.core/fn
  metabase.util.malli/defmethod                                                         schema.core/defmethod
  metabase.util.malli/defn                                                              schema.core/defn
  metabase.util.malli/defn-                                                             schema.core/defn
  metabase.util.malli/fn                                                                schema.core/fn
  metabase.util.namespaces/import-fns                                                   potemkin/import-vars
  metabase.util.performance/doseq                                                       clojure.core/doseq
  metabase.util.performance/for                                                         clojure.core/for
  metabase.util/with-timer-ms                                                           clojure.core/fn
  metabuild-common.core/with-open-jar-file-system                                       clojure.core/let
  metabuild-common.files/with-open-jar-file-system                                      clojure.core/let
  monger.operators/defoperator                                                          clojure.core/def
  potemkin.types/defprotocol+                                                           clojure.core/defprotocol
  potemkin.types/defrecord+                                                             clojure.core/defrecord
  potemkin.types/deftype+                                                               clojure.core/deftype
  potemkin/defprotocol+                                                                 clojure.core/defprotocol
  potemkin/defrecord+                                                                   clojure.core/defrecord
  potemkin/deftype+                                                                     clojure.core/deftype
  toucan.db/with-call-counting                                                          clojure.core/fn
  toucan2.core/with-call-count                                                          clojure.core/fn}

 :hooks
 {:analyze-call
  {cljs.core/def                                                                                                             hooks.clojure.core.def/lint-dynamic
   cljs.core/defn                                                                                                            hooks.clojure.core.def/lint-dynamic
   cljs.core/defn-                                                                                                           hooks.clojure.core.def/lint-dynamic
   cljs.core/defonce                                                                                                         hooks.clojure.core.def/lint-dynamic
   cljs.test/deftest                                                                                                         hooks.clojure.test/deftest
   cljs.test/is                                                                                                              hooks.clojure.test/is
   cljs.test/testing                                                                                                         hooks.clojure.test/testing
   cljs.test/use-fixtures                                                                                                    hooks.clojure.test/use-fixtures
   clojure.core/def                                                                                                          hooks.clojure.core.def/lint-def
   clojure.core/definterface                                                                                                 hooks.clojure.core.def/lint-def
   clojure.core/defmacro                                                                                                     hooks.clojure.core.defmacro/lint-defmacro
   clojure.core/defmulti                                                                                                     hooks.clojure.core.defmulti/lint-defmulti
   clojure.core/defn                                                                                                         hooks.clojure.core.defn/lint-defn
   clojure.core/defn-                                                                                                        hooks.clojure.core.defn/lint-defn
   clojure.core/defonce                                                                                                      hooks.clojure.core.def/lint-def
   clojure.core/defprotocol                                                                                                  hooks.clojure.core.def/lint-def
   clojure.core/defrecord                                                                                                    hooks.clojure.core.def/lint-def
   clojure.core/deftype                                                                                                      hooks.clojure.core.def/lint-def
   clojure.core/ex-info                                                                                                      hooks.metabase.agent-message/lint-ex-info
   clojure.core/ns                                                                                                           hooks.clojure.core.ns/lint-ns
   clojure.core/require                                                                                                      hooks.clojure.core.require/lint-require
   clojure.core/requiring-resolve                                                                                            hooks.clojure.core.require/lint-requiring-resolve
   clojure.core/with-redefs                                                                                                  hooks.clojure.core.with-redefs/lint-with-redefs
   clojure.core/-                                                                                                            hooks.metabase.util.timing/discourage-millis-duration
   clojure.test/deftest                                                                                                      hooks.clojure.test/deftest
   clojure.test/is                                                                                                           hooks.clojure.test/is
   clojure.test/testing                                                                                                      hooks.clojure.test/testing
   clojure.test/use-fixtures                                                                                                 hooks.clojure.test/use-fixtures
   malli.error/humanize                                                                                                      hooks.malli.error/humanize
   metabase-enterprise.advanced-permissions.models.permissions.application-permissions-test/with-new-group-and-current-graph hooks.common/with-two-top-level-bindings
   metabase-enterprise.audit-app.pages-test/with-temp-objects                                                                hooks.common/with-one-binding
   metabase-enterprise.cache.config-test/with-temp-persist-models                                                            hooks.common/with-seven-bindings
   metabase-enterprise.dependencies.api-test/with-dependents-test!                                                           hooks.common/with-two-bindings
   metabase-enterprise.metabot-v3.tools.dependencies-test/with-dependent-transforms!                                         hooks.common/with-two-bindings
   metabase-enterprise.remote-sync.metric-dimension-api-test/with-synced-metric                                              hooks.common/with-one-binding
   metabase-enterprise.search.semantic.db.connection/with-migrate-tx                                                         hooks.common/let-one-with-optional-value
   metabase-enterprise.serialization.api-test/with-serialization-test-data!                                                  hooks.common/with-three-bindings
   metabase-enterprise.serialization.test-util/with-temp-dpc                                                                 hooks.toucan2.tools.with-temp/with-temp
   metabase-enterprise.transforms-python.drivers-test/with-test-table                                                        hooks.common/with-two-bindings
   metabase.api.common.internal-test/with-jetty-server                                                                       hooks.common/with-one-binding
   metabase.api.macros/defendpoint                                                                                           hooks.metabase.api.macros/defendpoint
   metabase.app-db.schema-migrations-test.impl/test-migrations                                                               hooks.metabase.app-db.schema-migrations-test.impl/test-migrations!
   metabase.channel.render.js.pool/with-static-viz-context                                                                   hooks.common/with-one-top-level-binding
   metabase.channel.template.handlebars-helper/defhelper                                                                     hooks.metabase.channel.template.handlebars-helper/defhelper
   metabase.channel.template.handlebars-test/with-temp-template!                                                             hooks.common/with-vec-first-binding
   metabase.classloader.core/require                                                                                         hooks.clojure.core.require/lint-require
   metabase.classloader.impl/require                                                                                         hooks.clojure.core.require/lint-require
   metabase.collections-rest.api-test/with-french-user-and-personal-collection!                                              hooks.common/with-two-top-level-bindings
   metabase.collections.models.collection-test/with-collection-hierarchy!                                                    hooks.common/let-one-with-optional-value
   metabase.collections.models.collection-test/with-personal-and-impersonal-collections                                      hooks.common/with-two-bindings
   metabase.dashboards-rest.api-test/with-chain-filter-fixtures                                                              hooks.common/let-one-with-optional-value
   metabase.dashboards-rest.api-test/with-simple-dashboard-with-tabs                                                         hooks.common/with-one-binding
   metabase.dashboards.models.dashboard-tab-test/with-dashtab-in-personal-collection                                         hooks.common/with-one-top-level-binding
   metabase.dashboards.models.dashboard-test/with-dash-in-collection!                                                        hooks.common/with-three-bindings
   metabase.driver.bigquery-cloud-sdk-test/calculate-bird-scarcity                                                           hooks.metabase.query-processor.expressions-test/calculate-bird-scarcity
   metabase.driver.mongo-test/with-describe-table-for-sample                                                                 hooks.metabase.driver.mongo-test/with-describe-table-for-sample
   metabase.driver.oracle-test/with-temp-user                                                                                hooks.common/let-one-with-optional-value
   metabase.driver/register!                                                                                                 hooks.metabase.driver/register!
   metabase.driver-api/defenterprise                                                                                         hooks.metabase.premium-features.defenterprise/defenterprise
   metabase.embedding-rest.api.embed-test/do-response-formats                                                                hooks.common/with-two-bindings
   metabase.embedding-rest.api.embed-test/with-chain-filter-fixtures!                                                        hooks.common/let-one-with-optional-value
   metabase.embedding-rest.api.embed-test/with-temp-card                                                                     hooks.common/let-one-with-optional-value
   metabase.embedding-rest.api.embed-test/with-temp-dashcard                                                                 hooks.common/let-one-with-optional-value
   metabase.legacy-mbql.schema.macros/defclause                                                                              hooks.metabase.legacy-mbql.schemas.macros/defclause
   metabase.legacy-mbql.schema.macros/defclause*                                                                             hooks.metabase.legacy-mbql.schemas.macros/defclause*
   metabase.legacy-mbql.schema.macros/one-of                                                                                 hooks.metabase.legacy-mbql.schemas.macros/one-of
   metabase.lib.schema.mbql-clause/define-catn-mbql-clause                                                                   hooks.metabase.lib.schema.mbql-clause/define-mbql-clause
   metabase.lib.schema.mbql-clause/define-mbql-clause                                                                        hooks.metabase.lib.schema.mbql-clause/define-mbql-clause
   metabase.lib.schema.mbql-clause/define-tuple-mbql-clause                                                                  hooks.metabase.lib.schema.mbql-clause/define-mbql-clause
   methodical.core/defmethod                                                                                                 hooks.metabase.toucan.table-name/lint-defmethod
   methodical.macros/defmethod                                                                                               hooks.metabase.toucan.table-name/lint-defmethod
   metabase.app-db.core/query                                                                                                hooks.metabase.toucan.db-ns/lint-query-call
   metabase.app-db.core/streaming-reducible-query                                                                            hooks.metabase.toucan.db-ns/lint-query-call
   metabase.app-db.core/select-or-insert!                                                                                    hooks.metabase.toucan.db-ns/lint-query-call
   metabase.app-db.core/update-or-insert!                                                                                    hooks.metabase.toucan.db-ns/lint-query-call
   metabase.app-db.core/current-timestamp-string                                                                             hooks.metabase.toucan.db-ns/lint-query-call
   metabase.app-db.query/query                                                                                               hooks.metabase.toucan.db-ns/lint-query-call
   metabase.app-db.query/streaming-reducible-query                                                                           hooks.metabase.toucan.db-ns/lint-query-call
   metabase.app-db.query/select-or-insert!                                                                                   hooks.metabase.toucan.db-ns/lint-query-call
   metabase.app-db.query/update-or-insert!                                                                                   hooks.metabase.toucan.db-ns/lint-query-call
   metabase.app-db.query/current-timestamp-string                                                                            hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/count                                                                                                        hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/delete!                                                                                                      hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/exists?                                                                                                      hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/insert!                                                                                                      hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/insert-returning-instance!                                                                                   hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/insert-returning-instances!                                                                                  hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/insert-returning-pk!                                                                                         hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/insert-returning-pks!                                                                                        hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/query                                                                                                        hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/query-one                                                                                                    hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/reducible-query                                                                                              hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/reducible-select                                                                                             hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/reducible-update                                                                                             hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/reducible-update-returning-pks                                                                               hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/save!                                                                                                        hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/select                                                                                                       hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/select-fn->fn                                                                                                hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/select-fn->pk                                                                                                hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/select-fn-reducible                                                                                          hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/select-fn-set                                                                                                hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/select-fn-vec                                                                                                hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/select-one                                                                                                   hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/select-one-fn                                                                                                hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/select-one-pk                                                                                                hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/select-pk->fn                                                                                                hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/select-pks-set                                                                                               hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/select-pks-vec                                                                                               hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/update!                                                                                                      hooks.metabase.toucan.db-ns/lint-query-call
   toucan2.core/update-returning-pks!                                                                                        hooks.metabase.toucan.db-ns/lint-query-call
   metabase.lib.test-util.macros/$ids                                                                                        hooks.metabase.test.data/$ids
   metabase.lib.test-util.macros/mbql-query                                                                                  hooks.metabase.test.data/mbql-query
   metabase.lib.test-util.macros/mbql-5-query                                                                                hooks.metabase.test.data/mbql-query
   metabase.lib.test-util.macros/with-testing-against-standard-queries                                                       hooks.metabase.lib.test-util.macros/with-testing-against-standard-queries
   metabase.mcp.transport/jsonrpc-error                                                                                      hooks.metabase.agent-message/lint-jsonrpc-error
   metabase.mcp.v2.common/ellipsize                                                                                          hooks.metabase.agent-message/lint-ellipsize
   metabase.mcp.v2.common/error-content                                                                                      hooks.metabase.agent-message/lint-teaching-exit
   metabase.mcp.v2.common/list-content                                                                                       hooks.metabase.agent-message/lint-list-content
   metabase.mcp.v2.common/success-content                                                                                    hooks.metabase.agent-message/lint-success-content
   metabase.mcp.v2.common/throw-teaching-error                                                                               hooks.metabase.agent-message/lint-teaching-exit
   metabase.mcp.v2.message/msg                                                                                               hooks.metabase.agent-message/lint-msg
   metabase.mcp.v2.tools.browse/paged-list-content                                                                           hooks.metabase.agent-message/lint-list-content
   metabase.mcp.v2.tools.parameters-test/with-fixtures                                                                       hooks.common/with-one-binding
   metabase.metrics.api-dimension-test/with-seeded-metric                                                                    hooks.common/with-one-binding
   metabase.model-persistence.api-test/with-persistence-setup!                                                               hooks.common/with-one-top-level-binding
   metabase.model-persistence.api-test/with-setup!                                                                           hooks.common/with-one-top-level-binding
   metabase.model-persistence.test-util/with-persistence-enabled!                                                            hooks.metabase.model-persistence.test-util/with-persistence-enabled!
   metabase.mq.core/with-queue                                                                                               hooks.common/let-second
   metabase.mq.test-util/with-test-mq                                                                                        hooks.common/with-one-binding
   metabase.mq.core/def-listener!                                                                                            hooks.metabase.mq.impl/def-listener
   metabase.models.interface/define-batched-hydration-method                                                                 hooks.metabase.models.interface/define-hydration-method
   metabase.models.interface/define-simple-hydration-method                                                                  hooks.metabase.models.interface/define-hydration-method
   metabase.permissions.core/allow-changing-all-users-group-members                                                          hooks.common/do*
   metabase.permissions.core/disable-perms-cache                                                                             hooks.common/do*
   metabase.premium-features.core/defenterprise                                                                              hooks.metabase.premium-features.defenterprise/defenterprise
   metabase.premium-features.defenterprise/defenterprise                                                                     hooks.metabase.premium-features.defenterprise/defenterprise
   metabase.public-sharing-rest.api-test/with-required-param-card!                                                           hooks.common/with-one-binding
   metabase.public-sharing-rest.api-test/with-temp-public-card                                                               hooks.common/let-one-with-optional-value
   metabase.public-sharing-rest.api-test/with-temp-public-dashboard                                                          hooks.common/let-one-with-optional-value
   metabase.public-sharing-rest.api-test/with-temp-public-dashboard-and-card                                                 hooks.common/with-three-bindings
   metabase.pulse.api.alert-test/with-alert-in-collection!                                                                   hooks.common/with-four-bindings
   metabase.pulse.dashboard-subscription-test/with-link-card-fixture-for-dashboard                                           hooks.common/let-second
   metabase.pulse.models.pulse-test/with-dashboard-subscription-in-collection!                                               hooks.common/with-four-bindings
   metabase.pulse.models.pulse-test/with-pulse-in-collection!                                                                hooks.common/with-four-bindings
   metabase.pulse.test-util/checkins-query-card                                                                              hooks.metabase.test.data/$ids
   metabase.queries-rest.api.card-test/with-card-param-values-fixtures                                                       hooks.common/let-one-with-optional-value
   metabase.queries-rest.api.card-test/with-temp-native-card                                                                 hooks.common/with-two-bindings
   metabase.queries-rest.api.card-test/with-temp-native-card-with-params                                                     hooks.common/with-two-bindings
   metabase.query-processor.expressions-test/calculate-bird-scarcity                                                         hooks.metabase.query-processor.expressions-test/calculate-bird-scarcity
   metabase.query-processor.filter-test/count-with-filter-clause                                                             hooks.metabase.test.data/$ids
   metabase.query-processor.middleware.cache-test/with-mock-cache!                                                           hooks.common/with-two-bindings
   metabase.request.core/with-current-request                                                                                hooks.common/with-used-first-arg
   metabase.request.core/with-current-user                                                                                   hooks.common/with-used-first-arg
   metabase.request.core/with-limit-and-offset                                                                               hooks.common/with-used-first-two-args
   metabase.sample-data.impl-test/with-temp-sample-database-db                                                               hooks.common/with-one-binding
   metabase.search.api-test/with-search-items-in-collection                                                                  hooks.metabase.search.api-test/with-search-items-in-collection
   metabase.search.api-test/with-search-items-in-root-collection                                                             hooks.common/do*
   metabase.server.streaming-response-test/with-start-execution-chan                                                         hooks.common/with-one-binding
   metabase.settings.core/define-multi-setting                                                                               hooks.metabase.settings.models.setting/define-multi-setting
   metabase.settings.core/define-multi-setting-impl                                                                          hooks.metabase.settings.models.setting/define-multi-setting-impl
   metabase.settings.core/defsetting                                                                                         hooks.metabase.settings.models.setting/defsetting
   metabase.settings.models.setting.multi-setting/define-multi-setting                                                       hooks.metabase.settings.models.setting/define-multi-setting
   metabase.settings.models.setting.multi-setting/define-multi-setting-impl                                                  hooks.metabase.settings.models.setting/define-multi-setting-impl
   metabase.settings.models.setting/defsetting                                                                               hooks.metabase.settings.models.setting/defsetting
   metabase.stale-test/with-stale-items                                                                                      hooks.toucan2.tools.with-temp/with-temp
   metabase.test.data.datasets/test-driver                                                                                   hooks.metabase.test.data.datasets/test-driver
   metabase.test.data.datasets/test-drivers                                                                                  hooks.metabase.test.data.datasets/test-drivers
   metabase.test.data.users/with-group                                                                                       hooks.common/let-one-with-optional-value
   metabase.test.data/$ids                                                                                                   hooks.metabase.test.data/$ids
   metabase.test.data/dataset                                                                                                hooks.metabase.test.data/dataset
   metabase.test.data/mbql-query                                                                                             hooks.metabase.test.data/mbql-query
   metabase.test.data/run-mbql-query                                                                                         hooks.metabase.test.data/mbql-query
   metabase.test.util.async/with-open-channels                                                                               hooks.common/let-with-optional-value-for-last-binding
   metabase.test.util.generators.jvm/with-random-cards                                                                       hooks.metabase.test.util.generators.jvm/with-random-cards
   metabase.test.util.log/with-log-level                                                                                     hooks.common/with-ignored-first-arg
   metabase.test.util/discard-setting-changes                                                                                hooks.common/with-ignored-first-arg
   metabase.test.util/with-column-remappings                                                                                 hooks.common/with-ignored-first-arg
   metabase.test.util/with-non-admin-groups-no-root-collection-perms                                                         hooks.common/do*
   metabase.test.util/with-prometheus-system!                                                                                hooks.common/with-two-bindings
   metabase.test.util/with-temp-file                                                                                         hooks.metabase.test.util/with-temp-file
   metabase.test.util/with-temporary-setting-values                                                                          hooks.metabase.test.util/with-temporary-setting-values
   metabase.test/$ids                                                                                                        hooks.metabase.test.data/$ids
   metabase.test/dataset                                                                                                     hooks.metabase.test.data/dataset
   metabase.test/discard-setting-changes                                                                                     hooks.common/with-ignored-first-arg
   metabase.test/mbql-query                                                                                                  hooks.metabase.test.data/mbql-query
   metabase.test/query                                                                                                       hooks.metabase.test.data/mbql-query
   metabase.test/run-mbql-query                                                                                              hooks.metabase.test.data/mbql-query
   metabase.test/test-driver                                                                                                 hooks.metabase.test.data.datasets/test-driver
   metabase.test/test-drivers                                                                                                hooks.metabase.test.data.datasets/test-drivers
   metabase.test/with-column-remappings                                                                                      hooks.common/with-ignored-first-arg
   metabase.test/with-group                                                                                                  hooks.common/let-one-with-optional-value
   metabase.test/with-log-level                                                                                              hooks.common/with-ignored-first-arg
   metabase.test/with-log-messages-for-level                                                                                 hooks.metabase.util.log.capture/with-log-messages-for-level
   metabase.test/with-non-admin-groups-no-root-collection-perms                                                              hooks.common/do*
   metabase.test/with-persistence-enabled!                                                                                   hooks.metabase.model-persistence.test-util/with-persistence-enabled!
   metabase.test/with-prometheus-system!                                                                                     hooks.common/with-two-bindings
   metabase.test/with-random-premium-token!                                                                                  hooks.common/with-one-binding
   metabase.test/with-temp                                                                                                   hooks.toucan2.tools.with-temp/with-temp
   metabase.test/with-temp-file                                                                                              hooks.metabase.test.util/with-temp-file
   metabase.test/with-temporary-setting-values                                                                               hooks.metabase.test.util/with-temporary-setting-values
   metabase.tracing.test-util/with-span-exporter                                                                             hooks.common/with-one-binding
   metabase.users-rest.api-test/with-temp-user-email!                                                                        hooks.common/with-one-binding
   metabase.util.i18n/deferred-trs                                                                                           hooks.metabase.util.i18n/deferred-trs
   metabase.util.i18n/deferred-tru                                                                                           hooks.metabase.util.i18n/deferred-tru
   metabase.util.i18n/trs                                                                                                    hooks.metabase.util.i18n/trs
   metabase.util.i18n/tru                                                                                                    hooks.metabase.util.i18n/tru
   metabase.util.log.capture/with-log-messages-for-level                                                                     hooks.metabase.util.log.capture/with-log-messages-for-level
   metabase.util.log/debug                                                                                                   hooks.metabase.util.log/info
   metabase.util.log/debugf                                                                                                  hooks.metabase.util.log/infof
   metabase.util.log/error                                                                                                   hooks.metabase.util.log/info
   metabase.util.log/errorf                                                                                                  hooks.metabase.util.log/infof
   metabase.util.log/fatal                                                                                                   hooks.metabase.util.log/info
   metabase.util.log/fatalf                                                                                                  hooks.metabase.util.log/infof
   metabase.util.log/info                                                                                                    hooks.metabase.util.log/info
   metabase.util.log/infof                                                                                                   hooks.metabase.util.log/infof
   metabase.util.log/trace                                                                                                   hooks.metabase.util.log/info
   metabase.util.log/tracef                                                                                                  hooks.metabase.util.log/infof
   metabase.util.log/warn                                                                                                    hooks.metabase.util.log/info
   metabase.util.log/warnf                                                                                                   hooks.metabase.util.log/infof
   metabase.util.malli.defn/defn                                                                                             hooks.clojure.core.def/lint-dynamic
   metabase.util.malli.defn/defn-                                                                                            hooks.clojure.core.def/lint-dynamic
   metabase.util.malli.registry/def                                                                                          hooks.metabase.util.malli.registry/def
   metabase.util.malli/defn                                                                                                  hooks.clojure.core.def/lint-dynamic
   metabase.util.malli/defn-                                                                                                 hooks.clojure.core.def/lint-dynamic
   metabase.util.match/match-one                                                                                             hooks.metabase.util.match/match-one
   metabase.util.match/match-many                                                                                            hooks.metabase.util.match/match-many
   metabase.util.match/matches?                                                                                              hooks.metabase.util.match/matches?
   metabase.util.match/replace                                                                                               hooks.metabase.util.match/replace
   metabase.util.match/replace-all                                                                                           hooks.metabase.util.match/replace-all
   metabase.util.match/replace-in                                                                                            hooks.metabase.util.match/replace-in
   metabase.util/case-enum                                                                                                   hooks.metabase.util/case-enum
   metabase.util/format-color                                                                                                hooks.metabase.util/format-color
   metabase.xrays.api.automagic-dashboards-test/with-indexed-model!                                                          hooks.metabase.xrays.api.automagic-dashboards-test/with-indexed-model!
   taoensso.nippy/extend-freeze                                                                                              hooks.taoensso.nippy/extend-freeze
   taoensso.nippy/extend-thaw                                                                                                hooks.taoensso.nippy/extend-thaw}

  :macroexpand
  {clojurewerkz.quartzite.jobs/build                                                            macros.quartz/build-job
   clojurewerkz.quartzite.schedule.calendar-interval/build                                      macros.quartz/build-job
   clojurewerkz.quartzite.schedule.cron/schedule                                                macros.quartz/schedule
   clojurewerkz.quartzite.schedule.simple/schedule                                              macros.quartz/simple-schedule
   clojurewerkz.quartzite.triggers/build                                                        macros.quartz/build-trigger
   metabase-enterprise.database-routing.e2e-test/with-temp-dbs!                                 macros.metabase-enterprise.database-routing.e2e-test/with-temp-dbs!
   metabase-enterprise.database-routing.e2e-test/with-routing-setup!                            macros.metabase-enterprise.database-routing.e2e-test/with-routing-setup!
   metabase-enterprise.impersonation.util-test/with-impersonations!                             macros.metabase-enterprise.impersonation.util-test/with-impersonations!
   metabase-enterprise.query-reference-validation.api-test/with-test-setup!                     macros.metabase-enterprise.query-reference-validation.api-test/with-test-setup!
   metabase-enterprise.sandbox.test-util/with-gtaps!                                            macros.metabase-enterprise.sandbox.test-util/with-gtaps!
   metabase-enterprise.sandbox.test-util/with-gtaps-for-user!                                   macros.metabase-enterprise.sandbox.test-util/with-gtaps!
   metabase-enterprise.serialization.test-util/with-world                                       macros.metabase-enterprise.serialization.test-util/with-world
   metabase-enterprise.test/with-gtaps!                                                         macros.metabase-enterprise.sandbox.test-util/with-gtaps!
   metabase-enterprise.test/with-gtaps-for-user!                                                macros.metabase-enterprise.sandbox.test-util/with-gtaps!
   metabase.collections-rest.api-test/with-collection-hierarchy!                                macros.metabase.collections-rest.api-test/with-collection-hierarchy!
   metabase.collections-rest.api-test/with-some-children-of-collection!                         macros.metabase.collections-rest.api-test/with-some-children-of-collection!
   metabase.embedding-rest.api.embed-test/with-embedding-enabled-and-temp-card-referencing!     macros.metabase.embedding-rest.api.embed-test/with-embedding-enabled-and-temp-card-referencing!
   metabase.embedding-rest.api.embed-test/with-embedding-enabled-and-temp-dashcard-referencing! macros.metabase.embedding-rest.api.embed-test/with-embedding-enabled-and-temp-dashcard-referencing!
   metabase.lib.common/defop                                                                    macros.metabase.lib.common/defop
   metabase.lib.filter/deffilter                                                                macros.metabase.lib.filter/deffilter
   metabase.parameters.chain-filter-test/chain-filter                                           macros.metabase.parameters.chain-filter-test/chain-filter
   metabase.parameters.chain-filter-test/chain-filter-search                                    macros.metabase.parameters.chain-filter-test/chain-filter
   metabase.public-sharing-rest.api-test/with-sharing-enabled-and-temp-card-referencing!        macros.metabase.public-sharing-rest.api-test/with-sharing-enabled-and-temp-card-referencing!
   metabase.public-sharing-rest.api-test/with-sharing-enabled-and-temp-dashcard-referencing!    macros.metabase.public-sharing-rest.api-test/with-sharing-enabled-and-temp-dashcard-referencing!
   metabase.queries-rest.api.card-test/with-ordered-items                                       macros.metabase.queries-rest.api.card-test/with-ordered-items
   metabase.query-analysis.models.query-analysis-test/with-test-setup                           macros.metabase.query-analysis.models.query-analysis-test/with-test-setup
   metabase.query-analysis.task.test-setup/with-test-setup!                                     macros.metabase.query-analysis.task.test-setup/with-test-setup!
   metabase.query-processor.streaming/streaming-response                                        macros.metabase.query-processor.streaming/streaming-response
   metabase.server.statistics-handler-test/with-server                                          macros.metabase.server.statistics-handler-test/with-server
   metabase.task.core/defjob-type                                                               macros.quartz/defjob-type
   metabase.task.impl/defjob-type                                                               macros.quartz/defjob-type
   metabase.test.data.users/with-group-for-user                                                 macros.metabase.test.data.users/with-group-for-user
   metabase.test.util/with-temp-env-var-value!                                                  macros.metabase.test.util/with-temp-env-var-value!
   metabase.test.util/with-temporary-raw-setting-values                                         macros.metabase.test.util/with-temporary-raw-setting-values
   metabase.test/with-group-for-user                                                            macros.metabase.test.data.users/with-group-for-user
   metabase.test/with-temp-env-var-value!                                                       macros.metabase.test.util/with-temp-env-var-value!
   metabase.test/with-temporary-raw-setting-values                                              macros.metabase.test.util/with-temporary-raw-setting-values
   metabase.users.models.user-test/with-groups!                                                 macros.metabase.users.models.user-test/with-groups!
   metabase.util.namespaces/import-fn                                                           macros.metabase.util.namespaces/import-fn
   metabase.util.namespaces/import-macro                                                        macros.metabase.util.namespaces/import-macro
   metabase.xrays.related-test/with-world                                                       macros.metabase.xrays.related-test/with-world
   potemkin/import-def                                                                          macros.potemkin.namespaces/import-def
   potemkin/import-fn                                                                           macros.potemkin.namespaces/import-fn
   potemkin/import-macro                                                                        macros.potemkin.namespaces/import-macro
   potemkin.namespaces/import-def                                                               macros.potemkin.namespaces/import-def
   potemkin.namespaces/import-fn                                                                macros.potemkin.namespaces/import-fn
   potemkin.namespaces/import-macro                                                             macros.potemkin.namespaces/import-macro}}

 :config-in-comment
 {:linters {:unresolved-symbol {:level :off}}}

 ;;
 ;; TEST CONFIG
 ;;
 :ns-groups
 ;; the following patterns are considered to be test namespaces:
 ;;
 ;; - Any namespace ending in `-test` or `-test.whatever`
 ;; - Any namespace containing in `test-util`
 ;; - Any namespace that starts with `metabase.test`
 ;;
 ;; this list isn't exhaustive because it misses some stuff like the test runner and HTTP client but it's easier to go
 ;; fix those namespaces than it is to make this regex super hairy.
 [{:pattern "(?:.*-test(?:\\..*)?$)|(?:.*test-util)|(?:^metabase\\.test.*)"
   :name    test-namespaces}
  {:pattern "^(?!.*-test(?:\\..*)?$)(?!.*test-util)(?!^metabase\\.test.*).*$"
   :name    source-namespaces}
  {:pattern "(?:(?:^metabase\\.cmd.*)|(?:^build.*)|(?:^metabuild-common.*)|(?:^release.*)|(?:^i18n.*)|(?:^lint-migrations-file$))|(?:^mage.*)|(?:^load-namespaces.*)|(?:^dev\\..*)"
   :name    printable-namespaces}
  {:pattern "^metabase\\.(?:(?:lib)|(?:legacy-mbql))\\..*"
   :name    metabase-lib}
  {:pattern "^metabase\\.lib\\..*"
   :name    metabase-lib-excluding-legacy-mbql}
  {:pattern "^metabase\\.legacy-mbql\\..*"
   :name    legacy-mbql-namespaces}
  ;;
  ;; QP and driver source namespaces: `metabase.query-processor.*`, `metabase-enterprise.sandbox.query-processor.*`,
  ;; and `metabase.driver.*`, excluding `-test` namespaces.
  ;;
  {:pattern "metabase(?:(?:(?:-enterprise\\.sandbox)?\\.query-processor\\.)|(?:\\.driver\\.)).*(?<!-test)$"
   :name    qp-and-driver-source-namespaces}
  ;;
  ;; QP source namespaces
  ;;
  {:pattern "metabase(?:(?:-enterprise\\.sandbox)?\\.query-processor\\.).*(?<!-test)$"
   :name    qp-source-namespaces}
  ;;
  ;; driver namespaces, including tests
  ;;
  {:pattern "metabase\\.driver(?:-api)?.*$"
   :name    driver-namespaces}
  ;;
  ;; Perf-sensitive namespaces are currently the union of metabase.lib.*, driver namespaces, and QP (without tests).
  ;;
  {:pattern "^(?!.*-test(?:\\..*)?$)(?!.*test-util)(?!^metabase\\.test.*)^metabase\\.(lib|driver|legacy-mbql|query-processor).*"
   :name    performance-sensitive}
  ;;
  ;; general QP tests are ones that run across multiple drivers. Anything `metabase.query-processor*-test`,
  ;; `metabase.driver.sql*-test` (excluding SQLServer and SQLite), or
  ;; `metabase-enterprise.sandbox.query-processor*-test`
  ;;
  {:pattern "^metabase(?:((?:-enterprise\\.sandbox)?\\.query-processor)|(?:\\.driver\\.sql(?!server)(?!ite))).*-test$"
   :name    general-qp-and-driver-test-namespaces}
  {:pattern "(?:^mage.*)"
   :name    mage-namespaces}
  ;;
  ;; the app-db module is the application database layer itself (connections, migrations, encryption), so it gets to
  ;; run Toucan 2 queries anywhere.
  ;;
  {:pattern "^metabase\\.app-db\\..*"
   :name    app-db-namespaces}
  ;;
  ;; MCP source namespaces, OSS and enterprise, whose prose reaches an LLM agent, excluding test namespaces.
  ;;
  {:pattern "^(?!.*-test(?:\\..*)?$)(?!.*test-util)metabase(?:-enterprise)?\\.mcp\\..*"
   :name    agent-message-namespaces}
  ;;
  ;; MCP source namespaces whose caller-facing errors are MCP exits: `metabase.mcp.transport` and `metabase.mcp.v2.*`,
  ;; and their enterprise counterparts. Other MCP namespaces' 4xx `ex-info`s are admin API and middleware errors, not
  ;; MCP exits.
  ;;
  {:pattern "^(?!.*-test(?:\\..*)?$)(?!.*test-util)metabase(?:-enterprise)?\\.mcp\\.(?:transport$|v2\\..*)"
   :name    agent-exit-namespaces}]

 :config-in-ns
 {test-namespaces
  {:linters
   {:inline-def                                          {:level :off}
    :missing-docstring                                   {:level :off}
    :private-call                                        {:level :off}
    :metabase/defsetting-must-specify-export             {:level :off}
    :metabase/defsetting-namespace                       {:level :off}
    ;; Test fixtures and per-test overrides use `binding`-scoped dynamic vars legitimately; this ratchet
    ;; isn't aimed at that pattern. Mocking functions that way is the narrower case
    ;; `:metabase/prefer-with-dynamic-fn-redefs` already covers.
    :metabase/discourage-dynamic-vars                    {:level :off}
    :metabase/t2-query-namespace                         {:level :off}
    :metabase/test-helpers-use-non-thread-safe-functions {:level :warning} ; more config in `.clj-kondo/config/test-helpers/config.edn`

    :discouraged-var
    {metabase.driver/database-supports? {:level :off}
     metabase.lib.convert/->legacy-MBQL {:level :off}
     metabase.lib.core/->legacy-MBQL    {:level :off}}}}

  app-db-namespaces
  {:linters {:metabase/t2-query-namespace {:level :off}}}

  agent-message-namespaces
  {:linters {:metabase/agent-message-lines {:level :warning}}}

  agent-exit-namespaces
  {:linters {:metabase/agent-message-exit {:level :warning}}}

  ;; Namespaces whose values are marked. Adding one here is what keeps it that way; see
  ;; `metabase.app-db.value-guard`.
  metabase.content-translation.db
  {:linters {:metabase/unsafe-app-db-query {:level :warning}}}
  metabase.settings.db
  {:linters {:metabase/unsafe-app-db-query {:level :warning}}}

  metabase.auth-identity.db
  {:linters {:metabase/unsafe-app-db-query {:level :warning}}}

  metabase.usage-metadata.db
  {:linters {:metabase/unsafe-app-db-query {:level :warning}}}

  metabase.user-key-value.db
  {:linters {:metabase/unsafe-app-db-query {:level :warning}}}

  metabase.public-sharing.db
  {:linters {:metabase/unsafe-app-db-query {:level :warning}}}

  ;; .cljc tests run in both Clojure and ClojureScript — `with-dynamic-fn-redefs` is JVM-only,
  ;; so leave these alone.
  metabase.lib.aggregation-test
  {:linters {:metabase/prefer-with-dynamic-fn-redefs {:level :off}}}
  metabase.util.time-test
  {:linters {:metabase/prefer-with-dynamic-fn-redefs {:level :off}}}
  metabase.lib.metadata.calculation-test
  {:linters {:metabase/prefer-with-dynamic-fn-redefs {:level :off}}}

  ;; classloader sits below `util` in the module graph, so it can't use `metabase.util.log` without creating
  ;; a cycle; it gets to use tools.logging directly.
  metabase.classloader.impl
  {:linters {:discouraged-namespace {clojure.tools.logging {:level :off}}}}

  source-namespaces
  {:linters
   {:metabase/discourage-millis-duration               {:level :warning}
    :metabase/prefer-with-dynamic-fn-redefs            {:level :off}
    :metabase/validate-defendpoint-has-response-schema {:level :warning}
    :metabase/validate-escaped-single-quotes-in-i18n   {:level :warning}
    :metabase/validate-string-or-str-args-to-i18n      {:level :warning}

    :discouraged-var
    {clojure.core/with-redefs {:message "Don't use with-redefs outside of tests"}
     clojure.core/eval        {:message "Don't use eval outside of tests"}}

    :discouraged-namespace
    {metabase.legacy-mbql.normalize      {:message "Avoid legacy MBQL normalization, use MBQL 5 + lib/normalize instead"}
     metabase.legacy-mbql.schema         {:message "Avoid the legacy MBQL schema, use MBQL 5 + lib.schema instead"}
     metabase.legacy-mbql.schema.helpers {:message "Avoid the legacy MBQL schema, use MBQL 5 + lib.schema instead"}
     metabase.legacy-mbql.schema.macros  {:message "Avoid the legacy MBQL schema, use MBQL 5 + lib.schema instead"}
     metabase.legacy-mbql.util           {:message "Avoid legacy MBQL utils, use Lib instead"}
     metabase.query-processor.store      {:message "Please do not use the QP Store outside of legacy QP or driver code. Use MBQL 5/Lib or lib.metadata.jvm/applicaton-database-metadata-provider instead."}}}}

  printable-namespaces
  {:linters
   {:main-without-gen-class {:level :off}
    :discouraged-var        {clojure.pprint/pprint     {:level :off}
                             clojure.core/print        {:level :off}
                             clojure.core/printf       {:level :off}
                             clojure.core/println      {:level :off}
                             clojure.string/lower-case {:level :off}
                             clojure.string/upper-case {:level :off}}}}

  ;; enable all the extra linters we haven't enabled in the core app yet in Lib. It's all new code so we can adhere
  ;; to the new stricter rules from day 1
  metabase-lib
  {:linters
   {:docstring-leading-trailing-whitespace                {:level :warning}
    :used-underscored-binding                             {:level :warning}
    :keyword-binding                                      {:level :warning}
    :shadowed-var                                         {:level :warning}
    :metabase/deftest-not-marked-parallel-or-synchronized {:level :warning}

    ;; eventually we should do this for the whole codebase, but the args are in the opposite order so switching them
    ;; all at once isn't trivial, at least we can stop using it in new code.
    :discouraged-var
    {medley.core/map-keys               {:message "Use metabase.util.performance/update-keys"}
     medley.core/map-vals               {:message "Use clojure.core/update-vals"}
     metabase.lib.convert/->legacy-MBQL {:level :off}
     metabase.lib.core/->legacy-MBQL    {:level :off}
     metabase.test/with-temp            {:message "Don't use application database inside Lib code"}}

    :discouraged-namespace
    {metabase.driver            {:message "Lib code should be independent of driver code/methods"}
     metabase.test              {:message "Lib tests should only use Lib test helpers"}
     metabase.test.data         {:message "Lib tests should only use Lib test helpers"}
     metabase.util.malli.schema {:message "Prefer metabase.lib.schema schemas in Lib code"}
     toucan.db                  {:message "Don't use application database inside Lib code"}
     toucan.models              {:message "Don't use application database inside Lib code"}
     toucan.util.test           {:message "Don't use application database inside Lib code"}
     toucan2.core               {:message "Don't use application database inside Lib code"}}}}

  metabase-lib-excluding-legacy-mbql
  {}

  legacy-mbql-namespaces
  {:linters
   {:discouraged-namespace
    {metabase.legacy-mbql.normalize      {:level :off}
     metabase.legacy-mbql.schema         {:level :off}
     metabase.legacy-mbql.schema.helpers {:level :off}
     metabase.legacy-mbql.schema.macros  {:level :off}
     metabase.legacy-mbql.util           {:level :off}
     metabase.query-processor.store      {:level :off}}

    ;; the `metabase.legacy-mbql` stuff is all deprecated, so we don't need to warn inside the module about other stuff
    ;; in the module being marked deprecated or discouraged.
    :deprecated-namespace {:level :off}
    :deprecated-var       {:level :off}}}

  driver-namespaces
  {:linters
   {:discouraged-var
    {metabase.driver/database-supports? {:level :off}}

    ;; don't warn about the legacy MBQL namespaces being deprecated or discouraged in driver code now, we don't have a
    ;; real alternative YET so it's not a helpful warning.
    :discouraged-namespace
    {metabase.legacy-mbql.normalize      {:level :off}
     metabase.legacy-mbql.schema         {:level :off}
     metabase.legacy-mbql.schema.helpers {:level :off}
     metabase.legacy-mbql.schema.macros  {:level :off}
     metabase.legacy-mbql.util           {:level :off}
     metabase.query-processor.store      {:level :off}}

    :deprecated-namespace
    {:exclude
     [metabase.legacy-mbql.normalize
      metabase.legacy-mbql.schema
      metabase.legacy-mbql.schema.helpers
      metabase.legacy-mbql.schema.macros
      metabase.legacy-mbql.util
      metabase.query-processor.store]}

    :deprecated-var
    {:exclude
     {metabase.legacy-mbql.schema.helpers/is-clause?   {:namespaces ["metabase\\.driver.*"]}
      metabase.legacy-mbql.schema.helpers/mbql-clause? {:namespaces ["metabase\\.driver.*"]}
      metabase.legacy-mbql.util/query->source-table-id {:namespaces ["metabase\\.driver.*"]}
      metabase.legacy-mbql.util/aggregation-at-index   {:namespaces ["metabase\\.driver.*"]}
      metabase.legacy-mbql.util/assoc-field-options    {:namespaces ["metabase\\.driver.*"]}
      metabase.legacy-mbql.util/expression-with-name   {:namespaces ["metabase\\.driver.*"]}
      metabase.legacy-mbql.util/field-options          {:namespaces ["metabase\\.driver.*"]}
      metabase.legacy-mbql.util/negate-filter-clause   {:namespaces ["metabase\\.driver.*"]}
      metabase.legacy-mbql.util/normalize-token        {:namespaces ["metabase\\.driver.*"]}
      metabase.legacy-mbql.util/update-field-options   {:namespaces ["metabase\\.driver.*"]}}}}}

  performance-sensitive
  {:linters
   {:discouraged-var
    {clojure.core/empty?          {:message "Use metabase.util.performance/empty?"}
     clojure.core/not-empty       {:message "Use metabase.util.performance/not-empty"}
     clojure.core/every?          {:message "Use metabase.util.performance/every?"}
     clojure.core/mapv            {:message "Use metabase.util.performance/mapv"}
     clojure.core/run!            {:message "Use metabase.util.performance/run!"}
     clojure.core/get-in          {:message "Use metabase.util.performance/get-in"}
     clojure.core/select-keys     {:message "Use metabase.util.performance/select-keys"}
     clojure.core/some            {:message "Use metabase.util.performance/some"}
     clojure.core/update-keys     {:message "Use metabase.util.performance/update-keys"}
     clojure.walk/keywordize-keys {:message "Use metabase.util.performance/keywordize-keys"}
     clojure.walk/postwalk        {:message "Use metabase.util.performance/postwalk"}
     clojure.walk/prewalk         {:message "Use metabase.util.performance/prewalk"}
     clojure.walk/walk            {:message "Use metabase.util.performance/walk"}
     clojure.walk/for             {:message "Use metabase.util.performance/for"}
     clojure.walk/doseq           {:message "Use metabase.util.performance/doseq"}}}}

  qp-and-driver-source-namespaces
  {:linters
   {:discouraged-namespace
    {metabase.query-processor.store {:level :off}
     metabase.util.malli.schema     {:message "Prefer metabase.lib.schema or metabase.legacy-mbql.schema schemas in QP/driver code"}
     toucan.db                      {:message "Don't use application database directly in QP code; use the MetadataProvider"}
     toucan.models                  {:message "Don't use application database directly in QP code; use the MetadataProvider"}
     toucan.util.test               {:message "Don't use application database directly in QP code; use the MetadataProvider"}
     toucan2.core                   {:message "Don't use application database directly in QP code; use the MetadataProvider"}}

    :discouraged-var
    {medley.core/map-keys                 {:message "Use metabase.util.performance/update-keys"}
     medley.core/map-vals                 {:message "Use clojure.core/update-vals"}
     metabase.app-db.core/query           {:message "Don't use application database directly in QP code; use the MetadataProvider"}
     metabase.app-db.core/reducible-query {:message "Don't use application database directly in QP code; use the MetadataProvider"}
     metabase.lib.convert/->legacy-MBQL   {:level :off}
     metabase.lib.core/->legacy-MBQL      {:level :off}}}}

  qp-source-namespaces
  {}

  general-qp-and-driver-test-namespaces
  {:linters
   {:discouraged-var
    {metabase.test/with-column-remappings      {:message "Use lib.tu/remap-metadata-provider instead of with-column-remappings in QP tests"}
     metabase.test.util/with-column-remappings {:message "Use lib.tu/remap-metadata-provider instead of with-column-remappings in QP tests"}
     metabase.test/with-temp                   {:message "Use lib.tu/mock-metadata-provider in QP tests. Exceptions: tests for code that doesn't use MPs or models not supported by MPs"}
     toucan2.tools.with-temp/with-temp         {:message "Use lib.tu/mock-metadata-provider in QP tests. Exceptions: tests for code that doesn't use MPs or models not supported by MPs"}}

    :metabase/disallow-hardcoded-driver-names-in-tests
    {:level :warning}}}

  mage-namespaces
  {:linters
   {;; mage runs under babashka, which bundles cheshire; metabase.util.json is not on its classpath.
    :discouraged-namespace
    {cheshire.core {:level :off}}

    :discouraged-java-method
    {java.lang.System {exit
                       {:level :error
                        :message "Don't use System/exit directly. Instead use mage.util/exit and let mage handle exiting the process"}}}}}}}