Skip to content

Commit afa2655

Browse files
authored
Update Kondo version (#153)
* Update Kondo version * Update Kondo * Fix YAML
1 parent af7cd57 commit afa2655

File tree

7 files changed

+42
-31
lines changed

7 files changed

+42
-31
lines changed

.github/workflows/deploy.yml

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

88
jobs:
99
deploy:
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-latest
1111
environment: Deployment
1212
steps:
1313
- uses: actions/checkout@v4.1.0

.github/workflows/tests.yml

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,28 @@ on:
88

99
jobs:
1010
kondo:
11-
runs-on: ubuntu-22.04
11+
runs-on: ubuntu-latest
1212
timeout-minutes: 10
13-
env:
14-
CLJ_KONDO_VERSION: "2023.09.07"
15-
DOWNLOAD_URL: https://github.com/clj-kondo/clj-kondo/releases/download
1613
steps:
1714
- uses: actions/checkout@v4
1815
- name: Setup Java & Clojure
1916
uses: ./.github/actions/setup-clojure
2017
with:
2118
cache-key: kondo
22-
- name: Install clj-kondo
23-
run: |
24-
curl -OL ${DOWNLOAD_URL}/v${CLJ_KONDO_VERSION}/clj-kondo-${CLJ_KONDO_VERSION}-linux-static-amd64.zip
25-
curl -OL ${DOWNLOAD_URL}/v${CLJ_KONDO_VERSION}/clj-kondo-${CLJ_KONDO_VERSION}-linux-static-amd64.zip.sha256
26-
cat clj-kondo-${CLJ_KONDO_VERSION}-linux-static-amd64.zip.sha256 >> SHA256sum.txt
27-
echo " clj-kondo-${CLJ_KONDO_VERSION}-linux-static-amd64.zip" >> SHA256sum.txt
28-
sha256sum -c SHA256sum.txt
29-
unzip -d /usr/local/bin clj-kondo-${CLJ_KONDO_VERSION}-linux-static-amd64.zip
30-
- run: clj-kondo --version
3119
- name: Copy Kondo config from deps
3220
run: >-
33-
clj-kondo
21+
clojure -M:kondo
3422
--copy-configs
3523
--dependencies
3624
--lint "$(clojure -A:dev -Spath)"
3725
--skip-lint
3826
--parallel
3927
- name: Run clj-kondo
4028
run: >-
41-
clj-kondo
42-
--parallel
43-
--lint src test
29+
clojure -M:kondo:kondo/all
4430
4531
tests:
46-
runs-on: ubuntu-20.04
32+
runs-on: ubuntu-latest
4733
timeout-minutes: 10
4834
steps:
4935
- uses: actions/checkout@v4
@@ -57,7 +43,7 @@ jobs:
5743
CI: TRUE
5844

5945
whitespace-linter:
60-
runs-on: ubuntu-20.04
46+
runs-on: ubuntu-latest
6147
steps:
6248
- uses: actions/checkout@v4
6349
- name: Setup Java & Clojure
@@ -68,7 +54,7 @@ jobs:
6854
name: Run whitespace linter
6955

7056
check:
71-
runs-on: ubuntu-20.04
57+
runs-on: ubuntu-latest
7258
steps:
7359
- uses: actions/checkout@v4
7460
- name: Setup Java & Clojure
@@ -79,7 +65,7 @@ jobs:
7965
name: Check namespaces
8066

8167
codecov:
82-
runs-on: ubuntu-20.04
68+
runs-on: ubuntu-latest
8369
steps:
8470
- uses: actions/checkout@v4
8571
- name: Setup Java & Clojure
@@ -94,7 +80,7 @@ jobs:
9480
files: ./target/coverage/codecov.json
9581

9682
codespell:
97-
runs-on: ubuntu-20.04
83+
runs-on: ubuntu-latest
9884
steps:
9985
- uses: actions/checkout@v4
10086
- uses: codespell-project/actions-codespell@master

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@
2828
/tags
2929
/target
3030
\#*\#
31+
*.\~undo-tree\~

deps.edn

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
{:extra-paths ["dev" "test"]
1212

1313
:extra-deps
14-
{eftest/eftest {:mvn/version "0.5.9"}
14+
{clj-kondo/clj-kondo {:mvn/version "2025.01.16"}
15+
eftest/eftest {:mvn/version "0.5.9"}
1516
environ/environ {:mvn/version "1.2.0"}
1617
io.github.camsaul/humane-are {:mvn/version "1.0.2"}
1718
org.clojure/java.classpath {:mvn/version "1.0.0"}
@@ -49,6 +50,26 @@
4950
:exec-args {:only ["test"]}
5051
:jvm-opts ["-Dinhumane.test.output=true"]}
5152

53+
;; Run Kondo
54+
;;
55+
;; clojure -M:kondo --lint ...
56+
;;
57+
;; Copy configs
58+
;;
59+
;; clojure -M:kondo --copy-configs --dependencies --lint "$(clojure -A:dev -Spath)" --skip-lint --parallel
60+
:kondo
61+
{:replace-deps {clj-kondo/clj-kondo {:mvn/version "2025.01.16"}}
62+
:main-opts ["-m" "clj-kondo.main"]}
63+
64+
;; lint everything with Kondo
65+
;;
66+
;; clojure -M:kondo:kondo/all
67+
:kondo/all
68+
{:main-opts ["-m" "clj-kondo.main"
69+
"--lint"
70+
"src"
71+
"test"]}
72+
5273
;; clj -X:dev:cloverage
5374
:cloverage
5475
{:extra-deps {cloverage/cloverage {:mvn/version "1.2.4"}}

resources/clj-kondo.exports/methodical/methodical/config.edn

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{:config-paths ["macros"]
22

3-
:lint-as
4-
{}
3+
:config-in-call
4+
{methodical.core/defmethod
5+
{:linters
6+
{:redundant-fn-wrapper {:level :off}}}}
57

68
:hooks
79
{:analyze-call

resources/clj-kondo.exports/methodical/methodical/hooks/methodical/macros.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
'next-method
122122
'__FN__NAME__THAT__YOU__CANNOT__REFER__TO__))
123123
fn-tail))
124-
(vary-meta update :clj-kondo/ignore conj :redundant-fn-wrapper))]))]
124+
(with-meta (meta node)))]))]
125125
#_(println "=>")
126126
#_(clojure.pprint/pprint (hooks/sexpr result))
127127
{:node result})))

src/methodical/macros.clj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,13 @@
4949
[name-symb dispatch-fn {:keys [hierarchy dispatcher combo method-table cache default-value]
5050
:or {combo `(impl/thread-last-method-combination)
5151
method-table `(impl/standard-method-table)
52-
cache (if hierarchy
53-
`(impl/watching-cache (impl/simple-cache) [~hierarchy])
54-
`(impl/simple-cache))
5552
hierarchy '#'clojure.core/global-hierarchy}
5653
prefs :prefers}]
57-
(let [dispatch-fn (or dispatch-fn `identity)
54+
(let [cache (or cache
55+
(if hierarchy
56+
`(impl/watching-cache (impl/simple-cache) [~hierarchy])
57+
`(impl/simple-cache)))
58+
dispatch-fn (or dispatch-fn `identity)
5859
dispatcher (or dispatcher
5960
`(impl/multi-default-dispatcher ~dispatch-fn
6061
:hierarchy ~hierarchy

0 commit comments

Comments
 (0)