greglook / cljstyle

A tool for formatting Clojure code
Eclipse Public License 1.0
293 stars 39 forks source link

Handle shadow-cljs requires in ns forms #23

Closed brandonvin closed 4 years ago

brandonvin commented 4 years ago

shadow-cljs diverges from standard Clojure by allowing namespaces in an ns form to be strings instead of symbols. Normalize the libspec-sort-key to a string before sorting. Before this patch, the added test would fail with an exception:

java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Symbol

codecov-io commented 4 years ago

Codecov Report

Merging #23 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #23   +/-   ##
=======================================
  Coverage   73.57%   73.57%           
=======================================
  Files          10       10           
  Lines        1154     1154           
  Branches       27       27           
=======================================
  Hits          849      849           
  Misses        278      278           
  Partials       27       27
Impacted Files Coverage Δ
core/src/cljstyle/format/ns.clj 96.46% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 807c054...7c57fc8. Read the comment docs.