-
Notifications
You must be signed in to change notification settings - Fork 130
Open
Labels
Description
I mentioned this in #351 but enabling sort-ns-references will sort #_ comment forms to the top which breaks usage of :clj-kondo/ignore for particular namespaces, e.g.
(ns my.namespace
(:require
[a1.namespace]
#_{:clj-kondo/ignore [:discouraged-namespace]}
[a2.discouraged-namespace :as a2]))gets sorted to
(ns my.namespace
(:require
#_{:clj-kondo/ignore [:discouraged-namespace]}
[a1.namespace]
[a2.discouraged-namespace :as a2]))I think the desirable behavior in this case would be to treat commented-out map forms inside ns requires to be attached to the form after it the same way metadata is. For example when sorting this ns form the metadata map stays where it is.
(ns my.namespace
(:require
[a1.namespace]
^{:clj-kondo/ignore [:discouraged-namespace]}
[a2.discouraged-namespace] :as a2))Magisus, steveax, camsaul and borkdude