-
-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: update and extend tests for Clojure linters
- Loading branch information
1 parent
cea98d4
commit 2495266
Showing
7 changed files
with
111 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,57 @@ | ||
#_{:clj-kondo/ignore [:namespace-name-mismatch]} | ||
(ns foo | ||
(ns clojure-good-1 | ||
(:require | ||
[clojure.string :as str])) | ||
[clojure.string :as string])) | ||
|
||
|
||
(butlast [1 2 3]) | ||
|
||
(str/join "" "") | ||
(string/join "" "") | ||
|
||
|
||
(defn calculation | ||
[x] | ||
(let [y (fn [] (inc x))] | ||
(y))) | ||
|
||
(defn foo-fn [x] | ||
(let [y (fn [] (inc x))] | ||
(y))) | ||
|
||
(letfn | ||
[(f [g] (h g)) | ||
(h [i] (f i))]) | ||
[(f [g] (h g)) | ||
(h [i] (f i))]) | ||
|
||
(defn foo [] 1) | ||
(inc (foo)) | ||
|
||
(defn incremetal | ||
[] | ||
1) | ||
|
||
|
||
(inc (incremetal)) | ||
|
||
(Thread/sleep 1000 1) | ||
|
||
|
||
;; Here we switch to another namespace and require the previous: | ||
#_{:clj-kondo/ignore [:namespace-name-mismatch]} | ||
(ns bar (:require [foo :as f])) | ||
|
||
(f/foo-fn 1) | ||
|
||
(ns bar | ||
(:require | ||
[clojure-good-1 :as good])) | ||
|
||
|
||
(good/calculation 1) | ||
|
||
{:a 1 :b 2} | ||
#{1 2} | ||
{:a 1 :b 2} | ||
|
||
#_{:clj-kondo/ignore [:namespace-name-mismatch]} | ||
(ns bar-test (:require [clojure.test :as t])) | ||
|
||
(t/deftest my-tests | ||
(t/is (odd? (inc 1)))) | ||
|
||
(ns bar-test | ||
(:require | ||
[clojure.test :refer [deftest is testing]])) | ||
|
||
|
||
(deftest oddity-test | ||
(testing "Is something odd?" | ||
(is (odd? (inc 1))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,6 +83,7 @@ RUN apk add --update --no-cache \ | |
php8-simplexml \ | ||
composer \ | ||
dpkg \ | ||
zlib \ | ||
nodejs \ | ||
npm \ | ||
yarn \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,7 @@ RUN apk add --update --no-cache \ | |
openssh \ | ||
go \ | ||
openjdk11 \ | ||
zlib \ | ||
nodejs \ | ||
npm \ | ||
yarn \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters