From 555210175e2b1477734a0bd5c9b3ec26f4a7a8f8 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 24 Feb 2020 15:29:12 +0100 Subject: [PATCH] :sparkles: Add clj-kondo dependency for linting. --- backend/deps.edn | 5 +++++ backend/resources/.catacumba.basedir | 1 - backend/src/uxbox/services/mutations/icons.clj | 2 +- backend/tests/user.clj | 17 ++++++++++++++++- frontend/src/uxbox/main.cljs | 5 ----- 5 files changed, 22 insertions(+), 8 deletions(-) delete mode 120000 backend/resources/.catacumba.basedir diff --git a/backend/deps.edn b/backend/deps.edn index 58abac566..4a6ea3959 100644 --- a/backend/deps.edn +++ b/backend/deps.edn @@ -54,12 +54,17 @@ {com.bhauman/rebel-readline {:mvn/version "0.1.4"} org.clojure/tools.namespace {:mvn/version "1.0.0"} org.clojure/test.check {:mvn/version "1.0.0"} + clj-kondo {:mvn/version "RELEASE"} fipp/fipp {:mvn/version "0.6.21"} criterium/criterium {:mvn/version "0.4.5"} mockery/mockery {:mvn/version "0.1.4"}} :extra-paths ["tests"]} + :lint + {:extra-deps {clj-kondo {:mvn/version "RELEASE"}} + :main-opts ["-m" "clj-kondo.main"]} + :tests {:extra-deps {lambdaisland/kaocha {:mvn/version "0.0-581"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/backend/resources/.catacumba.basedir b/backend/resources/.catacumba.basedir deleted file mode 120000 index 1584cb97b..000000000 --- a/backend/resources/.catacumba.basedir +++ /dev/null @@ -1 +0,0 @@ -basedir \ No newline at end of file diff --git a/backend/src/uxbox/services/mutations/icons.clj b/backend/src/uxbox/services/mutations/icons.clj index 286f7c442..5c7329e13 100644 --- a/backend/src/uxbox/services/mutations/icons.clj +++ b/backend/src/uxbox/services/mutations/icons.clj @@ -97,7 +97,7 @@ set name = $2 where id = $1") -(defn select-library-for-update +(defn- select-library-for-update [conn id] (-> (db/query-one conn [sql:select-library-for-update id]) (p/then' su/raise-not-found-if-nil))) diff --git a/backend/tests/user.clj b/backend/tests/user.clj index f701b4450..a263c8a68 100644 --- a/backend/tests/user.clj +++ b/backend/tests/user.clj @@ -5,7 +5,7 @@ ;; This Source Code Form is "Incompatible With Secondary Licenses", as ;; defined by the Mozilla Public License, v. 2.0. ;; -;; Copyright (c) 2016-2019 Andrey Antukh +;; Copyright (c) 2016-2020 Andrey Antukh (ns user (:require @@ -17,6 +17,7 @@ [clojure.java.io :as io] [clojure.repl :refer :all] [criterium.core :refer [quick-bench bench with-progress-reporting]] + [clj-kondo.core :as kondo] [promesa.core :as p] [promesa.exec :as px] [uxbox.migrations] @@ -71,3 +72,17 @@ (do (require (symbol sns)) (test/test-vars [(resolve o)])) (test/test-ns o))))) + +(defn lint + ([] (lint "")) + ([path] + (-> (kondo/run! + {:lint [(str "src/" path)] + :cache false + :config {:linters + {:unresolved-symbol + {:exclude ['(uxbox.services.mutations/defmutation) + '(uxbox.services.queries/defquery) + '(promesa.core/let)]}}}}) + (kondo/print!)))) + diff --git a/frontend/src/uxbox/main.cljs b/frontend/src/uxbox/main.cljs index 4355e6264..698a8bd41 100644 --- a/frontend/src/uxbox/main.cljs +++ b/frontend/src/uxbox/main.cljs @@ -27,12 +27,7 @@ [uxbox.util.storage :refer [storage]] [uxbox.util.timers :as ts])) -;; --- i18n - (declare reinit) -;; (rx/sub! i18n/locale-sub #(reinit)) - -;; --- Error Handling (defn- on-navigate [router path]