codewars / codewars-runner-cli

Old CodeRunner project. See https://github.com/codewars/runner instead.
GNU Affero General Public License v3.0
400 stars 141 forks source link

Warnings result in a non-zero exit code in Clojure #769

Closed FArekkusu closed 4 years ago

FArekkusu commented 4 years ago

When you import a library some of the names in it may overlap with the built-ins which leads to warnings like the following ones:

WARNING: reverse already refers to: #'clojure.core/reverse in namespace: clojure.fcc.find-longest-word, being replaced by: #'clojure.string/reverse
WARNING: replace already refers to: #'clojure.core/replace in namespace: clojure.fcc.find-longest-word, being replaced by: #'clojure.string/replace

This in turn results in Exit code: 1 and counts as a test failure.

For example, the next 2 solutions work:

(ns clojure.fcc.find-longest-word
  (:use [clojure.string :only (split)]))

(defn find-longest-word [s]
  (reduce max (map count (split s #"\s+"))))
(ns clojure.fcc.find-longest-word)

(defn find-longest-word [s]
  (reduce max (map count (clojure.string/split s #"\s+"))))

While this solution doesn't:

(ns clojure.fcc.find-longest-word
  (:use [clojure.string :as s]))

(defn find-longest-word [s]
  (reduce max (map count (s/split s #"\s+"))))
kazk commented 4 years ago

Deployed the fix