Handles parsing and linting all of given files.
Handles parsing and linting all of given files.
(check-and-recur ctx form)
Check a given form and then map recur over each of the form's children.
Check a given form and then map recur over each of the form's children.
(check-and-store! ctx rule-names form)
Checks a given form against the appropriate rules then calls on-match
to build the
diagnostic and store it in ctx
.
Checks a given form against the appropriate rules then calls `on-match` to build the diagnostic and store it in `ctx`.
(check-files! ctx files)
Call into the relevant check-path-X
function, depending on the given config.
Call into the relevant `check-path-X` function, depending on the given config.
(check-form ctx rule-names form)
For each rule: if the rule is enabled, call check-rule
.
If check-rule
returns a non-nil result, add or append it to the accumulator.
Otherwise, return the accumulator.
For each rule: if the rule is enabled, call `check-rule`. If `check-rule` returns a non-nil result, add or append it to the accumulator. Otherwise, return the accumulator.
(check-pattern ctx rule pattern form)
Call :pattern
on the form and if it hits, call :on-match
on it.
Only attach parent-form
to the metadata after :pattern
is true, cuz
parent-form
can be potentially massive.
This has implications for pattern writing, where predicates can't rely on that metadata to exist.
Call `:pattern` on the form and if it hits, call `:on-match` on it. Only attach `parent-form` to the metadata after `:pattern` is true, cuz `parent-form` can be potentially massive. This has implications for pattern writing, where predicates can't rely on that metadata to exist.
(check-rule ctx rule form)
Rules either have :pattern
or :patterns
defined, never both.
To avoid iteration and seq manipulation costs, handle them separately.
Use reduced
to early exit when checking multiple patterns as we don't
want to create multiple diagnostics for a single form and rule.
Rules either have `:pattern` or `:patterns` defined, never both. To avoid iteration and seq manipulation costs, handle them separately. Use `reduced` to early exit when checking multiple patterns as we don't want to create multiple diagnostics for a single form and rule.
(parse-and-check-file ctx {:keys [ext file contents] :as file-obj})
Parse the given file and then check each form.
Parse the given file and then check each form.
(pre-filter-rules ctx)
Fully remove disabled rules or rules that don't apply to the current filetype.
Fully remove disabled rules or rules that don't apply to the current filetype.
(run args)
Convert command line args to usable options, pass to runner, print output.
Convert command line args to usable options, pass to runner, print output.
(run-impl paths options)
Actually perform check.
Actually perform check.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close