Liking cljdoc? Tell your friends :D

meme.config

Project-local formatter configuration.

Reads .meme-format.edn from the project root (walking up from a starting directory), validates it, and translates it into opts suitable for meme-lang.formatter.canon/format-form.

Config schema:

{:width positive integer (default 80) :structural-fallback? boolean — infer defn-/let-like shapes for unregistered heads :form-shape map of symbol → symbol. Each entry aliases a user macro to an existing registry entry, e.g. {my-defn defn, my-let let}. :style partial override of the canonical style. Merged on top of canon/style; supports :head-line-slots and :force-open-space-for. :slot-renderers is not supported from EDN (renderers are fns — not EDN-representable).}

Unknown keys are ignored with a warning so that newer configs stay forward-compatible with older tooling.

Project-local formatter configuration.

Reads `.meme-format.edn` from the project root (walking up from a
starting directory), validates it, and translates it into opts
suitable for `meme-lang.formatter.canon/format-form`.

Config schema:

  {:width                 positive integer (default 80)
   :structural-fallback?  boolean — infer defn-/let-like shapes
                          for unregistered heads
   :form-shape            map of symbol → symbol.  Each entry aliases
                          a user macro to an existing registry entry,
                          e.g. {my-defn defn, my-let let}.
   :style                 partial override of the canonical style.
                          Merged on top of canon/style; supports
                          :head-line-slots and :force-open-space-for.
                          :slot-renderers is not supported from EDN
                          (renderers are fns — not EDN-representable).}

Unknown keys are ignored with a warning so that newer configs stay
forward-compatible with older tooling.
raw docstring

config->optsclj

(config->opts config)

Translate a validated config map into opts for meme-lang.formatter.canon/format-form.

Computes the effective form-shape registry (base + aliases, optionally wrapped with structural fallback) and the effective style (canon/style merged with any override). Opts that were absent from the config are omitted so that per-call arguments can still override.

Translate a validated config map into opts for
`meme-lang.formatter.canon/format-form`.

Computes the effective form-shape registry (base + aliases, optionally
wrapped with structural fallback) and the effective style (canon/style
merged with any override).  Opts that were absent from the config are
omitted so that per-call arguments can still override.
sourceraw docstring

config-filenameclj

Filename used for project-local formatter config. Discovered by walking up the directory tree from the CWD.

Filename used for project-local formatter config. Discovered by walking
up the directory tree from the CWD.
sourceraw docstring

find-config-fileclj

(find-config-file start-dir)

Walk up from start-dir looking for .meme-format.edn. Returns the absolute File, or nil if none is found before the root.

Walk up from `start-dir` looking for `.meme-format.edn`.
Returns the absolute File, or nil if none is found before the root.
sourceraw docstring

read-config-fileclj

(read-config-file file)

Read and validate a .meme-format.edn file. Returns the parsed config map. Throws ex-info with ::config-error if the file is malformed or fails validation.

Read and validate a `.meme-format.edn` file.  Returns the parsed
config map.  Throws ex-info with ::config-error if the file is
malformed or fails validation.
sourceraw docstring

resolve-project-optsclj

(resolve-project-opts)
(resolve-project-opts start-dir)

Locate .meme-format.edn starting from start-dir (or CWD), read it, and return the derived opts map. Returns {} if no config is found. Errors in the config are thrown — the CLI catches and reports them.

Locate `.meme-format.edn` starting from `start-dir` (or CWD), read it,
and return the derived opts map.  Returns `{}` if no config is found.
Errors in the config are thrown — the CLI catches and reports them.
sourceraw docstring

validate-configclj

(validate-config config)

Validate a config map (already parsed from EDN). Throws ex-info with ::config-error on any violation. Warns on unknown keys.

Validate a config map (already parsed from EDN).  Throws ex-info with
::config-error on any violation.  Warns on unknown keys.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close