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

warn on variable which is marked unused, but is used anyway #861

Closed
jimka2001 opened this issue Apr 21, 2020 · 2 comments
Closed

warn on variable which is marked unused, but is used anyway #861

jimka2001 opened this issue Apr 21, 2020 · 2 comments

Comments

@jimka2001
Copy link
Contributor

jimka2001 commented Apr 21, 2020

clj-kondo already supports flagging unused variable declarations.
I can name a variable starting with _ to signal that I don't want the warning for a particular variable. However, if I then accidentally use such a variable, clj-kondo does not warn me that I've used a variable marked as unused.

I would like such variable declarations (or use sites) to be flagged.

(defn foo (f g) ;; g is unused, so warn
  {:sigma (fn (x _y) (f x))   ;; correct _y is unused, but don't warn
   :alpha (fn (x _y)  (f x _y))})   ;; _y is used, so warn
@stale
Copy link

stale bot commented Dec 3, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the expired expired - might be closed due to too little activity label Dec 3, 2021
@borkdude borkdude removed the expired expired - might be closed due to too little activity label Dec 3, 2021
@borkdude borkdude added this to Needs triage in clj-kondo via automation Dec 3, 2021
@borkdude borkdude moved this from Needs triage to Medium priority (new / enhance) in clj-kondo Dec 3, 2021
@borkdude
Copy link
Member

@jimka2001 This is now available in the newest clj-kondo under :used-underscored-binding.

clj-kondo automation moved this from Medium priority (new / enhance) to Done Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
clj-kondo
  
Done
Development

No branches or pull requests

2 participants