Liking cljdoc? Tell your friends :D

m1p.validation

Functions to validate dictionary parity. Parity is tested on a map of dictionaries keyed by "flavor" (e.g. locale for i18n dictionaries, theme for theme dictionaries, etc):

(def dicts
  {:en {:key1 "..."
        :key2 "..."}
   :nb {:key1 "..."
        :key2 "..."}})

Validation functions return a list of maps of :dictionary, :key, and a :kind of problem. Some validators include additional keys to contextualize the problem.

Functions to validate dictionary parity. Parity is tested on a map of
dictionaries keyed by "flavor" (e.g. locale for i18n dictionaries, theme for
theme dictionaries, etc):

```clj
(def dicts
  {:en {:key1 "..."
        :key2 "..."}
   :nb {:key1 "..."
        :key2 "..."}})
```

Validation functions return a list of maps of `:dictionary`, `:key`, and a
`:kind` of problem. Some validators include additional keys to contextualize
the problem.
raw docstring

dfn?clj/s

(dfn? f x)

Returns true if x is a reference to the dictionary function f, e.g.: (dfn? :fn/str [:fn/str "Hello"]) ;;=> true

Returns `true` if `x` is a reference to the dictionary function `f`, e.g.:
`(dfn? :fn/str [:fn/str "Hello"]) ;;=> true`
sourceraw docstring

find-fn-get-param-discrepanciesclj/s

(find-fn-get-param-discrepancies dicts)

Returns a list of all keys whose values use a different set of parameters with :fn/get.

Returns a list of all keys whose values use a different set of parameters with
`:fn/get`.
sourceraw docstring

find-fn-get-paramsclj/s

(find-fn-get-params x)

Recursively find all arguments used with :fn/get in x.

Recursively find all arguments used with `:fn/get` in `x`.
sourceraw docstring

find-interpolation-discrepanciesclj/s

(find-interpolation-discrepancies dicts)

Returns a list of all keys whose values use a different set of string interpolations.

Returns a list of all keys whose values use a different set of string
interpolations.
sourceraw docstring

find-misplaced-interpolationsclj/s

(find-misplaced-interpolations dicts)

Finds keys that use string interpolation syntax ({{:something}}) in strings outside of :fn/str.

Finds keys that use string interpolation syntax ({{:something}}) in strings
outside of `:fn/str`.
sourceraw docstring

find-missing-keysclj/s

(find-missing-keys dicts)

Finds all keys used across all dictionaries and returns a list of keys missing from individual dictionaries.

Finds all keys used across all dictionaries and returns a list of keys missing
from individual dictionaries.
sourceraw docstring

find-non-kw-keysclj/s

(find-non-kw-keys dicts)

Return a list of all keys across all dictionaries that are not keywords.

Return a list of all keys across all dictionaries that are not keywords.
sourceraw docstring

find-stray-interpolationsclj/s

(find-stray-interpolations v)
source

find-string-interpolationsclj/s

(find-string-interpolations x)

Recursively find all :fn/str references in x

Recursively find all `:fn/str` references in `x`
sourceraw docstring

find-type-discrepanciesclj/s

(find-type-discrepancies dicts)

Returns a list of all keys whose type is not the same across all dictionaries. The list will include one entry per dictionary for each key with type discrepancies.

Returns a list of all keys whose type is not the same across all dictionaries.
The list will include one entry per dictionary for each key with type
discrepancies.
sourceraw docstring

find-unqualified-keysclj/s

(find-unqualified-keys dicts)

Return a list of all keys across all dictionaries that don't have a namespace.

Return a list of all keys across all dictionaries that don't have a namespace.
sourceraw docstring

find-val-discrepanciesclj/s

(find-val-discrepancies kind dicts)

Returns a list of all keys across all dictionaries that have different values. Before calling this with dicts, pass it through a function that replace individual dictionary values with some symbolic type, e.g. call map-dictionary-vals with get-type or similar. kind is the :kind to assoc on the detected problems.

Returns a list of all keys across all dictionaries that have different values.
Before calling this with `dicts`, pass it through a function that replace
individual dictionary values with some symbolic type, e.g. call
`map-dictionary-vals` with `get-type` or similar. `kind` is the `:kind` to
assoc on the detected problems.
sourceraw docstring

format-cross-cutting-problemsclj/s

(format-cross-cutting-problems label xs)
source

format-keysclj/s

(format-keys f xs)
source

format-problemsclj/s

(format-problems dict xs)
source

format-reportclj/s

(format-report dicts problems)

Nicely format the list of problems as human-readable report

Nicely format the list of problems as human-readable report
sourceraw docstring

get-labelclj/smultimethod

Returns a label for the problem :kind suitable for use in the formatted report.

Returns a label for the problem `:kind` suitable for use in the formatted
report.
sourceraw docstring

get-typeclj/s

(get-type x)

Returns :string if the value is a string or a reference to :fn/str, otherwise the value's type.

Returns `:string` if the value is a string or a reference to `:fn/str`,
otherwise the value's `type`.
sourceraw docstring

get-valclj/s

(get-val v)
source

map-dictionary-valsclj/s

(map-dictionary-vals f dicts)

Maps of the values of each dictionary in dicts and returns the result, which is suitable for use with find-val-discrepancies.

Maps of the values of each dictionary in `dicts` and returns the result, which
is suitable for use with `find-val-discrepancies`.
sourceraw docstring

(print-report dicts problems)

Print a human-readable problem report to stdout

Print a human-readable problem report to stdout
sourceraw docstring

(print-seq sep seq)
source

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

× close