-
Notifications
You must be signed in to change notification settings - Fork 66
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
False positive "Namespace is never used" #210
Comments
Actually a workaround for this is to set |
Any updates or should it be closed? |
There were some improvements made to Eastwood on its reporting of unused namespaces, but I do not recall whether those improvements fix this case, or not. Here is a commit with the last of those changes to Eastwood that I am aware of. Those changes have been part of Eastwood since release version 0.2.5, so if someone could retest the problem case with Eastwood 0.2.5 or later and report here, that would be good to know. 9c2a32f Note: I would not be surprised if the problem case reported here is not improved by the changes I mentioned. |
As of the "0.3.13" version, this is still an issue. |
I added a draft PR with a testcase: #351. |
Are there any plans to address this issue? |
(I'm merely an occasional contributor) Looks like implementing a solution would entail creating a function akin to eastwood/src/eastwood/linters/unused.clj Line 269 in 7672782
Here is a sample (defn classes-used [asts]
(->> asts
(mapcat ast/nodes)
(keep :o-tag) ;; other "interesting" keys that can include a used class include: `:tag`, `:val`, `:result`
set)) I don't have enough tools.analyzer expertise to tell which of the keys I have observed to be "interesting" (:o-tag, :tag, :val, :result) would be the most suitable for properly fixing this linter. I'd encourage you to open a PR with a fix, spending a little more time in research than I did. Currently I lack the time/capability of opening proper PRs against Eastwood. Cheers - V |
Co-authored-by: Alexander Kouznetsov <alexander@liftoff.io>
When importing a class defined in another namespace with
defrecord
, it is necessary to firstrequire
the namespace so that the class is compiled before it can be imported (see https://clojuredocs.org/clojure.core/defrecord#example-542692d2c026201cdc326f87), but eastwood warns that the required namespace is never used.The text was updated successfully, but these errors were encountered: