Skip to content

Commit efde442

Browse files
committed
Upgrade clj-kondo
This also enables (and fixes found issues from) some of the newer linters.
1 parent d92cf1e commit efde442

File tree

7 files changed

+40
-21
lines changed

7 files changed

+40
-21
lines changed

.clj-kondo/config.edn

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,23 @@
33
clojure.java.jdbc/with-db-transaction clojure.core/let}
44

55
:linters
6-
{:unresolved-symbol
6+
{:consistent-alias
7+
{:aliases {clojure.string str
8+
9+
honey.sql hsql
10+
11+
next.jdbc jdbc
12+
next.jdbc.prepare jdbc.prepare
13+
next.jdbc.result-set jdbc.result-set
14+
next.jdbc.sql sql
15+
next.jdbc.types jdbc.types}}
16+
17+
;; use false?/true? instead of = false/true
18+
:equals-false {:level :warning}
19+
:equals-true {:level :warning}
20+
21+
;; warn if assoc-in/get-in/update-in are used with a single key
22+
:single-key-in {:level :warning}
23+
24+
:unresolved-symbol
725
{:exclude [(clojure.test/is [match?])]}}}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pom.xml
2424
/.nrepl-port
2525
/local-resources
2626

27-
.clj-kondo/.cache
27+
.clj-kondo/*
28+
!.clj-kondo/config.edn
2829
bin/.cache
2930
.cpcache

bin/clj-kondo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
set -euo pipefail
55

6-
CLJ_KONDO_VERSION="2023.09.07"
6+
CLJ_KONDO_VERSION="2023.10.20"
77
ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../" && pwd)
88

99
function ensure_clj_kondo() {

src/clojars/auth.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
form-config
7171
(::friend/auth-config request))
7272
#'workflows/interactive-login-redirect)
73-
(update-in request [::friend/auth-config] merge form-config)))))))
73+
(update request ::friend/auth-config merge form-config)))))))
7474

7575
(defn parse-authorization-header
7676
"Parses a Basic auth header into username and password."

src/clojars/http_utils.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
(fn [req]
1111
(let [response (handler req)]
1212
(if (= 200 (:status response))
13-
(update-in response [:headers] assoc "Access-Control-Allow-Origin" "*")
13+
(update response :headers assoc "Access-Control-Allow-Origin" "*")
1414
response))))
1515

1616
(defn https-request? [req]

src/clojars/routes/api.clj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
(assoc
1717
:recent_versions (db/recent-versions db group-id artifact-id)
1818
:downloads (stats/download-count stats group-id artifact-id))
19-
(update-in [:recent_versions]
20-
(fn [versions]
21-
(map (fn [version]
22-
(assoc version
23-
:downloads (stats/download-count stats group-id artifact-id (:version version))))
24-
versions)))
19+
(update :recent_versions
20+
(fn [versions]
21+
(map (fn [version]
22+
(assoc version
23+
:downloads (stats/download-count stats group-id artifact-id (:version version))))
24+
versions)))
2525
response)
2626
(not-found nil)))
2727

test/clojars/unit/verification_test.clj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616
help/with-clean-database)
1717

1818
(deftest test-group+domain-correspond?
19-
(are [exp group domain]
20-
(= exp (nut/group+domain-correspond? group domain))
21-
true "com.foo" "foo.com"
22-
true "com.foo.bar" "foo.com"
23-
false "com.foo" "foo.org"
24-
false "com.foo.bar" "foo.org"
25-
false "foo" "foo"
26-
false "foo." ".foo"
27-
false "" ""
28-
false nil nil))
19+
(are [pred group domain]
20+
(pred (nut/group+domain-correspond? group domain))
21+
true? "com.foo" "foo.com"
22+
true? "com.foo.bar" "foo.com"
23+
false? "com.foo" "foo.org"
24+
false? "com.foo.bar" "foo.org"
25+
false? "foo" "foo"
26+
false? "foo." ".foo"
27+
false? "" ""
28+
false? nil nil))
2929

3030
(deftest verify-group-by-TXT-with-invalid-domain
3131
(are [given] (= "The domain name is not a valid domain name."

0 commit comments

Comments
 (0)