Liking cljdoc? Tell your friends :D

formatting-stack.strategies

Strategies are concerned with generating a seq of filenames to process (format, lint, or compile).

They are configured to run in a determinate order.

In practice, a strategy is function that receives a seq of filenames, and returns another:

  • more filenames may be added; and or
  • the passed filenames may be filtered.

A strategy may not return nil.

Strategies are concerned with generating a seq of filenames to process (format, lint, or compile).

They are configured to run in a determinate order.

In practice, a strategy is function that receives a seq of filenames, and returns another:

* more filenames may be added; and or
* the passed filenames may be `filter`ed.

A strategy may not return nil.
raw docstring

all-filesclj

(all-files & {:keys [files]})

This strategy unconditionally processes all files.

This strategy unconditionally processes all files.
raw docstring

do-not-use-cached-results!clj

(do-not-use-cached-results! & {:keys [files]})

Normally, subsequent 'members' (formatters, linters, compilers) using identical strategies will cache the results of those strategies. That is apt for formatters that do safe modifications, but not for more dangerous formatters.

By adding this empty strategy, it is signaled that the member using it should not use a cached result.

You can find a detailed explanation/example in https://git.io/fh7E0 .

Normally, subsequent 'members' (formatters, linters, compilers)
using identical strategies will cache the results of those strategies.
That is apt for formatters that do safe modifications, but not for more dangerous formatters.

By adding this empty strategy, it is signaled that the member using it should not use a cached result.

You can find a detailed explanation/example in https://git.io/fh7E0 .
raw docstring

exclude-cljsclj

(exclude-cljs & {:keys [files]})

This strategy excludes .cljs files; .cljc files are not excluded in any case.

This strategy excludes .cljs files; .cljc files are not excluded in any case.
raw docstring

exclusively-cljsclj

(exclusively-cljs & {:keys [files]})

This strategy excludes files not suffixed in .cljs or .cljc

This strategy excludes files not suffixed in .cljs or .cljc
raw docstring

files-with-a-namespaceclj

(files-with-a-namespace & {:keys [files]})

This strategy excludes files that don't begin with a (ns ...) form.

This strategy excludes files that don't begin with a `(ns ...)` form.
raw docstring

git-completely-stagedclj

(git-completely-staged
  &
  {:keys [files impl]
   :or {impl (impl/file-entries "git" "status" "--porcelain")}})

This strategy processes the new or modified files that are completely staged with git.

This strategy processes the new or modified files that are _completely_ staged with git.
raw docstring

git-diff-against-default-branchclj

(git-diff-against-default-branch
  &
  {:keys [target-branch impl files blacklist]
   :or {target-branch "master"
        impl (impl/file-entries "git" "diff" "--name-only" target-branch)
        blacklist (git-not-completely-staged)}})

This strategy processes all files that this branch has modified. The diff is compared against the :target-branch option.

This strategy processes all files that this branch has modified.
The diff is compared against the `:target-branch` option.
raw docstring

git-not-completely-stagedclj

(git-not-completely-staged
  &
  {:keys [files impl]
   :or {impl (impl/file-entries "git" "status" "--porcelain")}})

This strategy processes all files that are not completely staged with git. Untracked files are also included.

This strategy processes all files that are not _completely_ staged with git. Untracked files are also included.
raw docstring

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

× close