Skip to content

clean-ns: false positives for symbol usage #239

Closed
@vemv

Description

@vemv

Hi!

Sometimes I may want to :require something just for using the alias later for symbol construction, with no var usage.

For example:

(ns om.g
  (:require
   [protocols.xyz :as xyz]))

(defn abc-impl [this] ...)

(defn new []
  ^{`xyz/abc abc-impl}
  {})

The above is a vanilla usage of metadata-based protocol extension, a new Clojure 1.10 feature.

If the ns didn't use xyz for any vars, clean-ns will wipe the require. And Clojure won't complain when compiling the ns again, since:

`xyz/abc

...is always a valid token.

Thanks - Victor

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions