Problem 1:
When adding a reader macro attached to a required namespace, the reader macro is treated as its own element rather than a comment on the namespace. This means the reader macro will be sorted as an element and no longer attached to the namespace.
Before:
(ns my-ns
(:require
[a.b]
#_:clj-kondo/ignore
[c.d]))
After:
(ns my-ns
(:require
#_:clj-kondo/ignore
[a.b]
[c.d]))
Problem 2:
Complex reader macros such as #_{:clj-kondo/ignore [:discouraged-namespace]} will cause cljstyle to crash with an exception.
Example:
(ns my-ns
(:require
[a.b]
#_{:clj-kondo/ignore [:discouraged-namespace]}
[c.d]))
Exception:
Error while processing file my_file.clj
Formatter threw IllegalArgumentException at position 1:1 while calling cljstyle.format.ns/rewrite-ns
Failed to process 1 files
Problem 1:
When adding a reader macro attached to a required namespace, the reader macro is treated as its own element rather than a comment on the namespace. This means the reader macro will be sorted as an element and no longer attached to the namespace.
Before:
After:
Problem 2:
Complex reader macros such as
#_{:clj-kondo/ignore [:discouraged-namespace]}will cause cljstyle to crash with an exception.Example:
Exception: