diff --git a/.clj-kondo/config.edn b/.clj-kondo/config.edn new file mode 100644 index 0000000000..691d216fdd --- /dev/null +++ b/.clj-kondo/config.edn @@ -0,0 +1,24 @@ +{:linters {:unused-namespace + {:exclude [clj-kondo.impl.rewrite-clj-patch + rewrite-clj.parser.core + clj-kondo.impl.var-info-gen + clj-kondo.impl.node.seq + clj-kondo.impl.profiler]} + :unresolved-symbol + {:exclude [(clj-kondo.impl.utils/one-of)]} + :unused-referred-var + {:exclude {clojure.test [is deftest testing]}} + :type-mismatch + {:level :warning + :namespaces + {clj-kondo.core {print! {:arities {1 {:args [:map] + :ret :nil}}} + run! {:arities {1 {:args [:map] + :ret :map}}}} + clj-kondo.impl.config #include "../src/clj_kondo/impl/config.types.edn" + clj-kondo.impl.findings #include "../src/clj_kondo/impl/findings.types.edn"}} + :missing-docstring {:level :off} + :unsorted-required-namespaces {:level :warning}} + :lint-as {me.raynes.conch/programs clojure.core/declare + me.raynes.conch/let-programs clojure.core/let} + :output {:exclude-files ["src/clj_kondo/impl/rewrite_clj_patch.clj"]}} \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c32d38cccc..cd0804a378 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,3 +43,21 @@ jobs: - name: Run tests run: | script/test/jvm + + lint: + # ubuntu 18.04 comes with lein + java8 installed + runs-on: ubuntu-18.04 + steps: + - name: Git checkout + uses: actions/checkout@v1 + with: + fetch-depth: 1 + submodules: 'true' + + - uses: DeLaGuardo/setup-clj-kondo@v1 + with: + version: '2020.04.05' + + - name: Lint + run: | + script/lint diff --git a/.gitignore b/.gitignore index 194c42ba70..1e828ad69c 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,11 @@ # shadow-cljs cache, port files /.shadow-cljs/ .idea/ + +.clj-kondo/.cache + +# Mac OS files +.DS_Store + +# Emacs files +.#* diff --git a/script/lint b/script/lint new file mode 100755 index 0000000000..a2a5115572 --- /dev/null +++ b/script/lint @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -eo pipefail + +# Find installation instructions here https://github.com/borkdude/clj-kondo/blob/554d7d93e2eb78ff21cfbbee4a084c4b6e089411/doc/install.md + +# TODO remove this when all warnings have been fixed +clj-kondo --lint src || echo " +[FIXME] fix above warnings and remove this warning" \ No newline at end of file