The (leiningen) facing interface for Kibit. Provides helpers for finding files in a project, and linting a list of files.
The (leiningen) facing interface for Kibit. Provides helpers for finding files in a project, and linting a list of files.
(clojure-file? file)
Returns true if the java.io.File represents a Clojure source file. Extensions taken from https://github.com/github/linguist/blob/master/lib/linguist/languages.yml
Returns true if the java.io.File represents a Clojure source file. Extensions taken from https://github.com/github/linguist/blob/master/lib/linguist/languages.yml
(ends-with? file coll)
Returns true if the java.io.File ends in any of the strings in coll
Returns true if the java.io.File ends in any of the strings in coll
(exec {:keys [paths reporter replace interactive] :as _options})
Given a Clojure CLI-style map options
, turn this map
into an equivalent set of options as expected by run and external-run above.
Please note that rules is not supported. nil is passed to external-run below which enables all rules (see kibit.rules/all-rules).
DO NOT escape the dobule-quotes in deps.edn or on the command-line.
To make use of this, add an alias, e.g. kibit, to deps.edn:
:kibit {:extra-deps {jonase/kibit {:mvn/version "0.1.11"}}
:exec-fn kibit.driver/exec
:exec-args {:paths ["src" "test"]}}
Then run:
clojure -X:kibit
Additional command-line options can be added in deps.edn or on the command-line. For example, in deps.edn:
:kibit {:extra-deps {jonase/kibit {:mvn/version "0.1.11"}}
:exec-fn kibit.driver/exec
:exec-args {:paths ["src" "test"]
:interactive true}}
Or on the command-line:
clojure -X:kibit :interactive true
To use babashka.cli, update the kibit alias in deps.edn:
:kibit {:extra-deps {jonase/kibit {:mvn/version "0.1.11"}}
org.babashka/cli {:mvn/version "0.7.51"}}
:exec-fn kibit.driver/exec
:exec-args {:paths ["src" "test"]}
:main-opts ["-m" "babashka.cli.exec"]}
Then run:
clojure -X:kibit -i -r markdown
Given a [Clojure CLI-style map][Execute a function] `options`, turn this map into an equivalent set of options as expected by run and external-run above. Please note that rules is not supported. nil is passed to external-run below which enables all rules (see kibit.rules/all-rules). **DO NOT** escape the dobule-quotes in deps.edn or on the command-line. To make use of this, add an alias, e.g. kibit, to deps.edn: :kibit {:extra-deps {jonase/kibit {:mvn/version "0.1.11"}} :exec-fn kibit.driver/exec :exec-args {:paths ["src" "test"]}} Then run: clojure -X:kibit Additional command-line options can be added in deps.edn or on the command-line. For example, in deps.edn: :kibit {:extra-deps {jonase/kibit {:mvn/version "0.1.11"}} :exec-fn kibit.driver/exec :exec-args {:paths ["src" "test"] :interactive true}} Or on the command-line: clojure -X:kibit :interactive true To use [babashka.cli][babashka.cli], update the kibit alias in deps.edn: :kibit {:extra-deps {jonase/kibit {:mvn/version "0.1.11"}} org.babashka/cli {:mvn/version "0.7.51"}} :exec-fn kibit.driver/exec :exec-args {:paths ["src" "test"]} :main-opts ["-m" "babashka.cli.exec"]} Then run: clojure -X:kibit -i -r markdown [Execute a function]: https://clojure.org/reference/deps_and_cli#_execute_a_function [babashka.cli]: https://github.com/babashka/cli
(external-run source-paths rules & args)
Used by lein-kibit to count the results and exit with exit-code 1 if results are found
Used by lein-kibit to count the results and exit with exit-code 1 if results are found
(find-clojure-sources-in-dir dir)
Searches recursively under dir for Clojure source files. Returns a sequence of File objects, in breadth-first sort order. Taken from clojure.tools.namespace.find
Searches recursively under dir for Clojure source files. Returns a sequence of File objects, in breadth-first sort order. Taken from clojure.tools.namespace.find
(run source-paths rules & args)
Runs the kibit checker against the given paths, rules and args.
Paths is expected to be a sequence of io.File objects.
Rules is either a collection of rules or nil. If rules is nil, all of kibit's checkers are used.
Optionally accepts a :reporter keyword argument, defaulting to "text" If :replace is provided in options, suggested replacements will be performed automatically.
Runs the kibit checker against the given paths, rules and args. Paths is expected to be a sequence of io.File objects. Rules is either a collection of rules or nil. If rules is nil, all of kibit's checkers are used. Optionally accepts a :reporter keyword argument, defaulting to "text" If :replace is provided in options, suggested replacements will be performed automatically.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close