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

unused-namespaces false positive with vars marked ^:const #192

Closed
camsaul opened this issue Mar 2, 2016 · 3 comments
Closed

unused-namespaces false positive with vars marked ^:const #192

camsaul opened this issue Mar 2, 2016 · 3 comments

Comments

@camsaul
Copy link

camsaul commented Mar 2, 2016

It looks like the :unused-namespaces linter is giving false positives when only constants are used from another namespace.

Example:

a.clj
(ns proj.a)

(def ^:const version "1.0.0")
b.clj
(ns proj.b
  (:require [proj.a :as a]))

(defn project-info []
   {:version a/version})
Error
src/proj/b.clj:1:1: unused-namespaces: Namespace proj.a is never used in proj.b
@camsaul camsaul changed the title unused-namespaces false poisitive with vars marked ^:const unused-namespaces false positive with vars marked ^:const Mar 2, 2016
@camsaul
Copy link
Author

camsaul commented Mar 2, 2016

I'm seeing the same thing with macros too. If these issues are hard to fix, it would be really helpful if I could exclusions for certain namespace usages in my Eastwood config file 👍

@jafingerhut
Copy link
Collaborator

I've looked into this a bit, and it isn't obvious if there is a quick straightforward way to account for these namespace uses for vars declared with ^:const in other namespaces. I'll keep the issue open in case someone thinks of a way.

@vemv
Copy link
Collaborator

vemv commented May 23, 2021

This was fixed with #363 , anyway I'll add a specific unit test relative to this issue

@vemv vemv closed this as completed in 0d1cb59 May 23, 2021
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

No branches or pull requests

3 participants