Skip to content

Create proper clj-kondo hooks for various macros #29

Closed
@seancorfield

Description

@seancorfield

more-of, more->, maybe others.

The following works for more->:

(ns hooks.expectations.clojure.test.more-thread
  (:require [clj-kondo.hooks-api :as api]))

(defn more-> [{:keys [node]}]
  (let [tail (rest (:children node))
        rewritten
        (api/list-node
         (list*
          (api/token-node 'cond->)
          (api/token-node 'nil)
          tail))]
    {:node rewritten}))

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions