mirror of
https://github.com/penpot/penpot.git
synced 2026-11-11 20:40:34 +00:00
📎 Improve clj-kondo hooks
Move the benchmark macro hooks into hooks.benches and add the missing license header to hooks.export. AI-assisted-by: deepseek-flash
This commit is contained in:
parent
a2d79fcbd5
commit
bab1458700
@ -24,9 +24,8 @@
|
||||
shadow.lazy/loadable hooks.export/rumext-lazycomponent
|
||||
app.util.i18n/tr hooks.i18n/tr-dynamic
|
||||
app.common.i18n/tr hooks.i18n/tr-dynamic
|
||||
benches.render-wasm.declarations/defscene hooks.export/benches-defscene
|
||||
benches.render-wasm.declarations/defcase hooks.export/benches-defcase
|
||||
}}
|
||||
benches.render-wasm.declarations/defscene hooks.benches/defscene
|
||||
benches.render-wasm.declarations/defcase hooks.benches/defcase}}
|
||||
|
||||
:output
|
||||
{:exclude-files
|
||||
@ -103,6 +102,4 @@
|
||||
|
||||
:unused-binding
|
||||
{:exclude-destructured-as true
|
||||
:exclude-destructured-keys-in-fn-args false
|
||||
}
|
||||
}}
|
||||
:exclude-destructured-keys-in-fn-args false}}}
|
||||
|
||||
26
.clj-kondo/hooks/benches.clj
Normal file
26
.clj-kondo/hooks/benches.clj
Normal file
@ -0,0 +1,26 @@
|
||||
;; This Source Code Form is subject to the terms of the Mozilla Public
|
||||
;; License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
;;
|
||||
;; Copyright (c) KALEIDOS SUBSIDIARY SL
|
||||
|
||||
(ns hooks.benches
|
||||
(:require [clj-kondo.hooks-api :as api]))
|
||||
|
||||
(defn defscene
|
||||
"Analyzes scene options and its compiled builder body."
|
||||
[{:keys [node]}]
|
||||
(let [[_ _ opts argv & body] (:children node)]
|
||||
(if (and argv (api/vector-node? argv))
|
||||
{:node (api/list-node [(api/token-node (quote do)) opts
|
||||
(api/list-node (into [(api/token-node (quote fn)) argv] body))])}
|
||||
{:node node})))
|
||||
|
||||
(defn defcase
|
||||
"Analyzes case options and its compiled operation body."
|
||||
[{:keys [node]}]
|
||||
(let [[_ _ opts argv & body] (:children node)]
|
||||
(if (and (seq body) argv (api/vector-node? argv))
|
||||
{:node (api/list-node [(api/token-node (quote do)) opts
|
||||
(api/list-node (into [(api/token-node (quote fn)) argv] body))])}
|
||||
{:node node})))
|
||||
@ -1,3 +1,9 @@
|
||||
;; This Source Code Form is subject to the terms of the Mozilla Public
|
||||
;; License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
;;
|
||||
;; Copyright (c) KALEIDOS SUBSIDIARY SL
|
||||
|
||||
(ns hooks.export
|
||||
(:require [clj-kondo.hooks-api :as api]))
|
||||
|
||||
@ -10,20 +16,6 @@
|
||||
sname])]
|
||||
{:node result}))
|
||||
|
||||
(defn benches-defscene
|
||||
[{:keys [node]}]
|
||||
(let [[_ _ opts argv & body] (:children node)]
|
||||
(if (and argv (api/vector-node? argv))
|
||||
{:node (api/list-node (into [(api/token-node (quote fn)) argv] body))}
|
||||
{:node node})))
|
||||
|
||||
(defn benches-defcase
|
||||
[{:keys [node]}]
|
||||
(let [[_ _ opts argv & body] (:children node)]
|
||||
(if (and (seq body) argv (api/vector-node? argv))
|
||||
{:node (api/list-node (into [(api/token-node (quote fn)) argv] body))}
|
||||
{:node node})))
|
||||
|
||||
(def registry (atom {}))
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user