[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add exclusion rules for defrecord with no fields #231

Closed
danielcompton opened this issue Sep 22, 2017 · 2 comments
Closed

Add exclusion rules for defrecord with no fields #231

danielcompton opened this issue Sep 22, 2017 · 2 comments

Comments

@danielcompton
Copy link
Contributor
danielcompton commented Sep 22, 2017

This code

(defrecord MyRecord [])

will generate these warnings:

== Linting co.deps.time ==
Entering directory `...'
.../time.clj:360:1: suspicious-expression: condp called with 3 args.  (condp pred test-expr expr) always returns expr.  Perhaps there are misplaced parentheses?
.../time.clj:360:1: suspicious-expression: and called with 1 args.  (and x) always returns x.  Perhaps there are misplaced parentheses?
.../time.clj:360:1: suspicious-expression: case called with 2 args.  (case x y) always returns y.  Perhaps there are misplaced parentheses?
.../time.clj:360:1: suspicious-expression: case called with 2 args.  (case x y) always returns y.  Perhaps there are misplaced parentheses?

These could be masked with exclusions?

@jafingerhut
Copy link
Collaborator

Were you using a recent Clojure 1.9.0 alpha or beta when you saw these? If so, I have seen them as well, and believe I have fixed them. Eastwood was using some knowledge of Clojure internal representation of defrecords to recognize empty ones with low false positive rate, and Clojure 1.9.0-alpha has a performance improvement for caching record hashing that broke that. The Eastwood commit with the fix is here: 2df53ae

If you want to try it out to see if it fixes the issue for you before the next Eastwood release, you can check out these instructions for locally installing an unreleased version of Eastwood from source code: https://github.com/jonase/eastwood#for-eastwood-developers

@jafingerhut jafingerhut added this to the Eastwood 0.2.5 milestone Oct 10, 2017
@danielcompton
Copy link
Contributor Author

Were you using a recent Clojure 1.9.0 alpha or beta when you saw these?

Yep, I was. I'll take a look at the new build when I get a chance. Thanks!

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

No branches or pull requests

2 participants