Skip to content

Commit 4d7cbac

Browse files
committed
Merge pull request #74 from miner/master
:suspcious-expression should not look into quoted expressions
2 parents ebd96e1 + 380d3da commit 4d7cbac

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/eastwood/linters/typos.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
; (-> (first asts) :env :ns the-ns)))
7070
forms (util/string->forms source this-ns false)
7171
freqs (->> forms
72-
util/replace-comments-with-nil
72+
util/replace-comments-and-quotes-with-nil
7373
flatten-also-colls
7474
(filter keyword?)
7575
frequencies)]
@@ -374,7 +374,7 @@ generate varying strings while the test is running."
374374
(apply
375375
concat
376376
(let [fs (-> forms
377-
util/replace-comments-with-nil
377+
util/replace-comments-and-quotes-with-nil
378378
(util/subforms-with-first-in-set
379379
(set (keys core-first-vars-that-do-little))))]
380380
(for [f fs]

src/eastwood/util.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@ try to generate code from it. It is fine for pprint'ing."
391391
form))
392392
form))
393393

394-
(defn replace-comments-with-nil [form]
395-
(replace-subforms-with-first-in-set form #{'comment} (constantly nil)))
394+
(defn replace-comments-and-quotes-with-nil [form]
395+
(replace-subforms-with-first-in-set form #{'comment 'quote} (constantly nil)))
396396

397397
(defn- mark-statements-in-try-body-post [ast]
398398
(if (and (= :try (:op ast))

0 commit comments

Comments
 (0)