Skip to content

:suspcious-expression should not look into quoted expressions#74

Merged
jafingerhut merged 1 commit intojonase:masterfrom
miner:master
Nov 2, 2014
Merged

:suspcious-expression should not look into quoted expressions#74
jafingerhut merged 1 commit intojonase:masterfrom
miner:master

Conversation

@miner
Copy link
Copy Markdown
Contributor

@miner miner commented Jun 19, 2014

I had some data expressions that sort of looked like code which caused spurious warnings from :suspicious-expression. My solution was to avoid linting any form inside a quote. I used the same mechanism that handled 'comment'. Please feel free to refactor as appropriate. I did not study the code too deeply.

@miner
Copy link
Copy Markdown
Contributor Author

miner commented Jun 19, 2014

By the way, here's the sort of thing that caused the original problem:

(deftest when-in-quoted-expr
(is (= 'when (first (fnext '(first (when (foo bar))))))))

@jafingerhut
Copy link
Copy Markdown
Collaborator

Thanks for the report and suggested fix. I have taken a look at it, and it looks fine, but I will wait to merge it until after I have had a chance to test it on the collection of 50 or so Clojure libraries I use to test Eastwood with.

jafingerhut added a commit that referenced this pull request Nov 2, 2014
:suspcious-expression should not look into quoted expressions
@jafingerhut jafingerhut merged commit 4d7cbac into jonase:master Nov 2, 2014
jafingerhut added a commit that referenced this pull request Nov 2, 2014
I already verified before merging the change for #74 that this new
test case did cause a :suspicious-expression warning, and as expected
that it does not with the change.
@jafingerhut
Copy link
Copy Markdown
Collaborator

Steve, thanks for the problem report and the fix. I will probably fix this in a different way in the future that eliminates other undesirable suspicious-expression warnings, but for now I've used your proposed change as is. It is part of Eastwood version 0.1.5, released today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants