Liking cljdoc? Tell your friends :D

kibit.driver

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.
raw docstring

cli-specsclj

source

clojure-file?clj

(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
sourceraw docstring

ends-with?clj

(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
sourceraw docstring

execclj

(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). I don't know what rules should be. A list of rule names as strings doesn't seem to be it.

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.2.0"}}
        :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.2.0"}}
        :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 aliasn in deps.edn:

:kibit {:extra-deps {jonase/kibit {:mvn/version "0.2.0"}}
                     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). I don't know what rules
should be. A list of rule names as strings doesn't seem to be it.

**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.2.0"}}
            :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.2.0"}}
            :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 aliasn in deps.edn:

    :kibit {:extra-deps {jonase/kibit {:mvn/version "0.2.0"}}
                         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
sourceraw docstring

external-runclj

(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
sourceraw docstring

find-clojure-sources-in-dirclj

(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
sourceraw docstring

runclj

(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.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close