Skip to content

Commit

Permalink
Merge pull request #142 from nedap/upgrade-eastwood--v2
Browse files Browse the repository at this point in the history
Upgrade Eastwood
  • Loading branch information
vemv authored Mar 3, 2020
2 parents 22b74b7 + ea2ddc9 commit 6bb7b03
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[com.nedap.staffing-solutions/utils.collections "2.0.0"]
[com.nedap.staffing-solutions/utils.modular "2.2.0-alpha3"]
[com.nedap.staffing-solutions/utils.spec.predicates "1.1.0"]
[jonase/eastwood "0.3.5"]
[jonase/eastwood "0.3.10"]
[medley "1.2.0"]
[org.clojure/clojure "1.10.1"]
[org.clojure/java.classpath "1.0.0"]
Expand Down
2 changes: 0 additions & 2 deletions src/formatting_stack/linters/eastwood.clj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
(assoc :linters linters))))

(defn lint! [{:keys [options]} filenames]
(reset! eastwood.util/warning-enable-config-atom []) ;; https://github.com/jonase/eastwood/issues/317
(let [namespaces (->> filenames
(remove #(str/ends-with? % ".edn"))
(keep ns-name-from-filename))
Expand All @@ -32,7 +31,6 @@
(->> @reports
:warnings
(map :warn-data)
(remove impl/contains-dynamic-assertions?)
(map (fn [{:keys [uri-or-file-name linter] :strs [warning-details-url] :as m}]
(assoc-some m
:level :warning
Expand Down
10 changes: 9 additions & 1 deletion test-resources/eastwood_warning.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(ns eastwood-warning)
(ns eastwood-warning
(:require
[clojure.spec.alpha :as spec]))

(def x (def y ::z))

Expand Down Expand Up @@ -32,3 +34,9 @@
[x]
{:pre [x *dynamic*]} ;; variation: *dynamic* is not the first member
logical-false)

;; This shouldn't raise any warnings. See https://github.com/jonase/eastwood/issues/337
(spec/coll-of any?)

;; This shouldn't raise any warnings. See https://github.com/jonase/eastwood/issues/336
(defmulti example-mm identity)
12 changes: 6 additions & 6 deletions test/functional/formatting_stack/linters/eastwood.clj
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
(matchers/in-any-order
[{:source :eastwood/warn-on-reflection
:msg "reference to field getPath can't be resolved"
:line 6
:column 25
:line pos-int?
:column pos-int?
:warning-details-url matchers/absent
:filename "test-resources/eastwood_warning.clj"}
{:source :eastwood/def-in-def
:line 3
:column 13
:line pos-int?
:column pos-int?
:warning-details-url "https://github.com/jonase/eastwood#def-in-def"
:filename "test-resources/eastwood_warning.clj"}
{:source :eastwood/wrong-pre-post
:line 22
:column 9
:line pos-int?
:column pos-int?
:warning-details-url "https://github.com/jonase/eastwood#wrong-pre-post"
:filename "test-resources/eastwood_warning.clj"}]))))

0 comments on commit 6bb7b03

Please sign in to comment.