Merge branch 'check-expr-11' of github.com:jonase/kibit
This commit is contained in:
commit
37e7c021a2
1 changed files with 11 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
replacements for patterns of code and remove general code lint"
|
||||
(:require [clojure.core.logic :as logic]
|
||||
[clojure.java.io :as io]
|
||||
[clojure.walk :as walk]
|
||||
[jonase.kibit.rules :as core-rules])
|
||||
(:import [clojure.lang LineNumberingPushbackReader]))
|
||||
|
||||
|
@ -53,6 +54,16 @@
|
|||
(when (sequential? expr)
|
||||
(some #(unify expr %) rules))))
|
||||
|
||||
(declare expr-seq)
|
||||
;; This walks across all the forms within a seq'd form/expression, checking each inner form
|
||||
;; We have to restore `:expr` because it gets munged in the tree/expr walk
|
||||
(defn check-expr
|
||||
"Given a full expression/form-of-forms/form, a map containing the alternative suggestion info, or `nil`"
|
||||
[expr]
|
||||
(if-let [new-expr (walk/walk #(or (-> % check-form :alt) %) check-form expr)]
|
||||
(assoc new-expr :expr expr)
|
||||
nil))
|
||||
|
||||
;; Building the parsable forms
|
||||
;; ---------------------------
|
||||
;;
|
||||
|
|
Loading…
Reference in a new issue