RubyCritic (Flog, Flay, Reek) as JSON for tingle code_check rubycritic.
193
The RubyCritic image behind the
tingle code_check rubycritic command of
tingle. It runs RubyCritic (Flog, Flay
and Reek) on a list of Ruby files and prints the report as one JSON object,
so tingle can check code complexity without a local Ruby setup.
Supported platforms: linux/amd64, linux/arm64.
| Component | Version |
|---|---|
| Ruby | 3.3.12 (ruby:3.3.12-slim, pinned by digest) |
| RubyCritic | 5.0.0 |
Every gem (Flog, Flay, Reek, parser, ...) is pinned by a committed
Gemfile.lock. The image has no git and no compiler, so RubyCritic computes
no churn.
/src). Blank lines are ignored; duplicates are kept once.report.json plus a
top-level parse_errors list. Files that can't be parsed (syntax errors,
invalid UTF-8, missing files) are listed there as {"path", "message"}
and are not analysed, so one broken file doesn't abort the whole run.
A top-level methods list holds Flog's per-method scores as
{"path", "name", "line", "score"}, most complex first.
With no analysable file, it prints
{"metadata":null,"analysed_modules":[],"score":null,"parse_errors":[...],"methods":[]}.0 when the JSON was printed (even with parse errors),
non-zero otherwise.The image works under any --user <uid>:<gid>, with no network and a
read-only /src. It only writes under /tmp. The project's own coverage/
folder (SimpleCov data) is ignored, so coverage is not reported.
tingle code_check rubycritic (preferred)Install tingle and run:
tingle code_check rubycritic <path>
The canonical run line:
find . -name '*.rb' | docker run --rm -i --pull never --network none \
--security-opt no-new-privileges --user "$(id -u):$(id -g)" \
-v "$PWD:/src:ro" -w /src darthjee/tingle_rubycritic:<tag>
1.0.0): the same string as the
matching tingle release and X.Y.Z git tag. tingle X.Y.Z uses
darthjee/tingle_rubycritic:X.Y.Z by default.latest tag.shell/linux/VERSION.Content type
Image
Digest
sha256:94d036ecd…
Size
80.4 MB
Last updated
2 days ago
docker pull darthjee/tingle_rubycritic:0.7.0