-
-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
823 additions
and
447 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
err=0 | ||
trap '(( err |= $? ))' ERR | ||
trap 'exit $err' SIGINT SIGTERM | ||
|
||
lein clj-kondo --lint "$(lein classpath)" | ||
|
||
exit "$err" |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
err=0 | ||
trap '(( err |= $? ))' ERR | ||
trap 'exit $err' SIGINT SIGTERM | ||
|
||
# Run as local root dependency | ||
rm -rf /tmp/proj | ||
mkdir -p /tmp/proj | ||
cd /tmp/proj | ||
clojure -Sdeps '{:deps {clj-kondo {:local/root "/home/circleci/repo"}}}' \ | ||
-m clj-kondo.main --lint /home/circleci/repo/src /home/circleci/repo/test | ||
|
||
# Run as git dependency | ||
rm -rf /tmp/proj | ||
mkdir -p /tmp/proj | ||
cd /tmp/proj | ||
clojure -Sdeps "{:deps {clj-kondo {:git/url \"https://github.com/borkdude/clj-kondo\" :sha \"$CIRCLE_SHA1\"}}}" \ | ||
-m clj-kondo.main --lint /home/circleci/repo/src /home/circleci/repo/test | ||
|
||
exit "$err" |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{:ignore-comments? false | ||
:debug? false} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
(ns corpus.cljc.test-cljc) | ||
|
||
#?(:clj (defn foo [x y] | ||
x) | ||
:cljs (defn foo [x] | ||
x)) | ||
|
||
;; valid calls on lines 9 and 10: | ||
#?(:clj (foo 1 2) | ||
:cljs (foo 1)) | ||
|
||
;; invalid calls on lines 13 and 14: | ||
#?(:clj (foo 1) | ||
:cljs (foo 1 2)) | ||
|
||
;; bar is function that is callable from both CLJ and CLJS: | ||
(defn bar [x] | ||
x) | ||
|
||
(bar 1) | ||
(bar 1 2 3) |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(ns corpus.cljc.test-cljc | ||
(:require [corpus.cljc.test-cljc :refer [foo]])) | ||
|
||
(foo 1) ;; correct | ||
(foo 1 2) ;; incorrect |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(ns corpus.cljc.test-cljc-from-clj | ||
(:require [corpus.cljc.test-cljc :refer [bar]])) | ||
|
||
;; why you no find this one? | ||
(bar 1 2 3) |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(ns corpus.cljc.test-cljs | ||
(:require [corpus.cljc.test-cljc :refer [foo bar]])) | ||
|
||
(foo 1) ;; correct | ||
(foo 1 2) ;; incorrect | ||
(bar 1 2) ;; incorrect | ||
|
||
(defn baz []) |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
(ns clojure.core) | ||
|
||
(defn get [x y] x) | ||
|
||
(ns corpus.exclude-clojure1 | ||
(:refer-clojure :exclude [get])) | ||
|
||
(get 1 2 3 4) | ||
|
||
(ns corpus.exclude-clojure2) | ||
|
||
(get 1 2 3 4) |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
(ns inline-def) | ||
|
||
(defn foo [] | ||
(def x 1)) | ||
|
||
(defn- foo [] | ||
(def x 1)) | ||
|
||
(def foo (def x 1)) | ||
|
||
(deftest foo (def x 1)) | ||
|
||
(defmacro foo [] (def x 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(ns corpus.invalid-arity.calls | ||
(:require [corpus.invalid-arity.defs | ||
:as x :refer [public-fixed | ||
public-varargs | ||
public-multi-arity]])) | ||
|
||
(public-fixed 1) | ||
(x/public-fixed 1) | ||
(corpus.invalid-arity.defs/public-fixed 1) | ||
(public-multi-arity 1 2 3) | ||
(public-varargs 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(ns corpus.invalid-arity.defs) | ||
|
||
(defn public-fixed [x y z] x) | ||
(defn public-multi-arity ([x] (public-multi-arity x false)) ([x y] x)) | ||
(defn public-varargs [x y & zs] x) | ||
|
||
(public-fixed 1) | ||
(public-multi-arity 1) | ||
(public-multi-arity 1 2) | ||
(public-multi-arity 1 2 3) | ||
(public-varargs 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
(ns corpus.invalid-arity.order) | ||
|
||
;; call to def special form with docstring | ||
(def x "the number one" 1) | ||
(defmacro def [k spec-form]) | ||
;; valid call to macro | ||
(def ::foo int?) | ||
;; invalid call to macro | ||
(def ::foo int? string?) |
Oops, something went wrong.