Skip to content

Commit 6f731d6

Browse files
Harden clj-kondo and zprint, scope lint triggers
2 parents 8611d7a + 545a022 commit 6f731d6

10 files changed

Lines changed: 57 additions & 32 deletions

File tree

.clj-kondo/config.edn

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,27 @@
33
:unused-namespace {:level :error}
44
:unused-referred-var {:level :error}
55
:unused-private-var {:level :error}
6+
:unused-value {:level :error}
7+
:unused-import {:level :error}
68
:unresolved-symbol {:level :error}
79
:unresolved-namespace {:level :error}
810
:unresolved-var {:level :error}
911
:type-mismatch {:level :error}
1012
:redundant-do {:level :error}
1113
:redundant-let {:level :error}
1214
:redundant-fn-wrapper {:level :error}
15+
:redundant-call {:level :error}
1316
:missing-else-branch {:level :error}
17+
:misplaced-docstring {:level :error}
1418
:used-underscored-binding {:level :error}
1519
:unsorted-required-namespaces {:level :error}
20+
:aliased-namespace-symbol {:level :error}
1621
:consistent-alias {:level :error}
1722
:single-key-in {:level :error}
1823
:refer-all {:level :error}
1924
:duplicate-require {:level :error}
2025
:namespace-name-mismatch {:level :error}
26+
:non-arg-vec-return-type-hint {:level :error}
2127
:unexpected-recur {:level :error}
2228
:condition-always-true {:level :error}
23-
:shadowed-var {:level :error :exclude [name runner]}}}
29+
:shadowed-var {:level :error :exclude [name]}}}

.github/workflows/lint.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Lint
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
47

58
permissions:
69
contents: read

src/vmlinux/gha/artifacts.clj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(ns vmlinux.gha.artifacts
2-
(:require [babashka.fs :as fs]
3-
[clojure.edn :as edn]
4-
[vmlinux.krn.build :as build]))
2+
(:require
3+
[babashka.fs :as fs]
4+
[clojure.edn :as edn]
5+
[vmlinux.krn.build :as build]))
56

67
(defrecord VmLinuxArtifact [artifact-name])
78
(defrecord ArtifactMeta [arch version binary sha256-sum])

src/vmlinux/gha/release.clj

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(ns vmlinux.gha.release
2-
(:require [babashka.fs :as fs]
3-
[babashka.process :refer [shell]]
4-
[selmer.parser :as p]))
2+
(:require
3+
[babashka.fs :as fs]
4+
[babashka.process :refer [shell]]
5+
[selmer.parser :as p]))
56

67
(defn- release-tag [sha] (str "release-" sha))
78

@@ -23,15 +24,23 @@
2324
:exit
2425
zero?))
2526

27+
(defn- upload!
28+
[tag asset]
29+
(loop [attempt 1]
30+
(let [exit (:exit (shell {:continue true} "gh" "release" "upload" tag asset))]
31+
(cond (zero? exit) :ok
32+
(< attempt 6) (do (Thread/sleep (* attempt 2000)) (recur (inc attempt)))
33+
:else (throw (ex-info (str "gh release upload failed for " asset) {:asset asset}))))))
34+
2635
(defn create
27-
[sha vmlinux-builds]
28-
(assert (not (exists? sha)) (str "release already exists: " (release-tag sha)))
36+
[sha assets]
2937
(let [tag (release-tag sha)]
30-
(shell "gh" "release" "create" tag "--title" (title sha) "--notes" (notes sha))
31-
(->> vmlinux-builds
38+
(when-not (exists? sha)
39+
(shell "gh" "release" "create" tag "--title" (title sha) "--notes" (notes sha)))
40+
(->> assets
3241
(mapv (fn [build]
3342
(future (let [asset (str (fs/parent (:binary-path build)) "/" (asset-name build))]
3443
(fs/copy (:binary-path build) asset {:replace-existing true})
35-
(shell "gh" "release" "upload" tag asset)))))
44+
(upload! tag asset)))))
3645
(run! deref))
3746
tag))

src/vmlinux/krn/build.clj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
(ns vmlinux.krn.build
22
(:refer-clojure :exclude [compile])
3-
(:require [babashka.fs :as fs]
4-
[babashka.process :refer [shell]]
5-
[clojure.string :as str]))
3+
(:require
4+
[babashka.fs :as fs]
5+
[babashka.process :refer [shell]]
6+
[clojure.string :as str]))
67

78
(defrecord VmLinuxBuild [arch version binary-path sha256-sum])
89

src/vmlinux/krn/src.clj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(ns vmlinux.krn.src
2-
(:require [babashka.fs :as fs]
3-
[babashka.process :refer [shell]]
4-
[clojure.string :as str]))
2+
(:require
3+
[babashka.fs :as fs]
4+
[babashka.process :refer [shell]]
5+
[clojure.string :as str]))
56

67
(defrecord KernelSrc [tarball-url checksums-url])
78
(defrecord KernelTree [path checksum])

src/vmlinux/tasks/compile.clj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
(ns vmlinux.tasks.compile
2-
(:require [manifest :as mf]
3-
[vmlinux.gha.artifacts :as artifacts]
4-
[vmlinux.krn.build :as kbuild]
5-
[vmlinux.krn.src :as src]))
2+
(:require
3+
[manifest :as mf]
4+
[vmlinux.gha.artifacts :as artifacts]
5+
[vmlinux.krn.build :as kbuild]
6+
[vmlinux.krn.src :as src]))
67

78
(defn- by-name [name] (first (filter #(= name (:name %)) mf/builds)))
89

src/vmlinux/tasks/fmt.clj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
(ns vmlinux.tasks.fmt
2-
(:require [babashka.deps :as deps]
3-
[babashka.fs :as fs]))
2+
(:require
3+
[babashka.deps :as deps]
4+
[babashka.fs :as fs]))
45

5-
(def ^:private opts {:width 100, :style :community})
6+
(def ^:private opts {:width 100, :style [:community :how-to-ns]})
67

78
(defn- sources [] (map str (fs/glob "." "{src/**/*.clj,manifest.clj}")))
89

src/vmlinux/tasks/matrix.clj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
(ns vmlinux.tasks.matrix
2-
(:require [cheshire.core :as json]
3-
[manifest :as mf]))
2+
(:require
3+
[cheshire.core :as json]
4+
[manifest :as mf]))
45

5-
(def ^:private arch-runner {:x86_64 "ubuntu-24.04", :aarch64 "ubuntu-24.04-arm"})
6+
(def ^:private arch-runner {:x86_64 "ultralarge-24.04-x64", :aarch64 "ultralarge-24.04-aarch64"})
67

78
(defn matrix
89
[]

src/vmlinux/tasks/release.clj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(ns vmlinux.tasks.release
2-
(:require [clojure.java.io :as io]
3-
[vmlinux.gha.artifacts :as artifacts]
4-
[vmlinux.gha.release :as release]))
2+
(:require
3+
[clojure.java.io :as io]
4+
[vmlinux.gha.artifacts :as artifacts]
5+
[vmlinux.gha.release :as release]))
56

67
(defn- artifact-dirs
78
[dir]

0 commit comments

Comments
 (0)