Scan your whole stack
From OX Research Newsroom
Are you using gruff-py?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.6.0
gruff-py was last scanned on 29 Nov 2026 at version 0.6.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.6.0 LATEST | 29 Nov 2026 | No rules fired |
Findings for v0.6.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.6.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
gruff-py is the Python port of gruff, a static quality analyser built to keep AI-generated code legible, safe, and reviewable. It walks Python projects, scores findings across quality pillars, and outputs reports for terminals, CI annotations, SARIF code scanning, static HTML, and a local dashboard.
A coding agent wrote the change, and a person who did not write it has to review and trust it. Every rule, severity, and score serves that reviewer, not abstract style. Wired into a coding-agent hook, gruff-py guides the agent with advisory findings and gates it with --fail-on warning and error findings so changes stay:
Doc comments are mandatory, even on a private one-liner. Agents often write code that looks like it works while misreading the requirement; stating intent, usage, contract, and failure behaviour gives the reviewer something to check the code against, and a mismatch is itself a reason to look closer.
gruff-py is heuristic static analysis. It complements ruff, mypy, pytest, security scanners, and human review; it does not replace them. docs/mission.md has the full statement.
| Field | Value |
|---|---|
| Release line | 0.6.0 package line |
| Runtime | Python 3.11+ |
| Package | gruff-py |
| Import package | gruffpy with py.typed |
| Binary | gruff-py |
| Rule catalogue | Generated from RuleRegistry.defaults(); see Rules |
| Primary config | .gruff-py.yaml; [tool.gruff-py] in pyproject.toml is also supported |
| Analysis schema | gruff.analysis.v3 |
| Baseline schema | gruff.baseline.v3; gruff-py.baseline.v1 and gruff.baseline.v1 fail closed with a migration command |
| Severity gate | --fail-on with none, advisory, warning, error; project default via failOn: in .gruff-py.yaml / pyproject.toml |
| Dashboard | 127.0.0.1:8765 by default |
Finding fingerprints are 16-character SHA-256 prefixes kept byte-compatible with gruff-php wherever rule and finding identities match. Analysis JSON uses the shared gruff.analysis.v3 schema, while hotspot and config schemas stay language-prefixed (gruff-py.*).
Each JSON finding also includes stableIdentity, a line-insensitive companion to fingerprint that lets baselines and external diff tools match the same logical finding across line shifts. See docs/output-formats.md for the exact fields hashed into each identity.
3.11+.uv for source-checkout development.Install as a project dev dependency:
uv add --dev gruff-py
uv run gruff-py init
uv run gruff-py summary
From a source checkout:
uv sync
uv run gruff-py --help
./bin/gruff-py --help
# Create the project config.
uv run gruff-py init
# Review the current finding mix.
uv run gruff-py summary
# Explore without failing because of findings.
uv run gruff-py analyse src/ --fail-on none
# Gate on warning and error findings.
uv run gruff-py analyse src/ --fail-on warning
# Emit SARIF for code scanning.
uv run gruff-py analyse src/ --format sarif --fail-on none > gruff.sarif
# Generate a fresh-start baseline.
uv run gruff-py analyse src/ --generate-baseline --fail-on none
# Start the local dashboard.
uv run gruff-py dashboard src/ --report-interactive
Open http://127.0.0.1:8765/ for the dashboard.
| Command | Purpose |
|---|---|
init |
Write a default .gruff-py.yaml to the current directory. |
analyse [paths...] |
Run the analyser and print findings. |
summary [paths...] |
Print compact score, pillar, rule, and file summaries. |
report [paths...] |
Render an HTML or JSON report to stdout or --output. |
list-rules [rule-id] |
Print rule metadata as text or JSON; pass a rule id for explain mode. |
check-ignore [paths...] |
Report whether each path is ignored, and why (exit codes mirror git check-ignore). |
hook [paths...] |
Run analysis for a coding-agent hook; emits gruff.hook.v2 JSON. |
migrate-config |
Rewrite legacy config keys to the current schema; --dry-run prints the diff. |
dashboard [paths...] |
Serve the local browser dashboard. |
completion [shell] |
Print a shell completion script. |
list, help |
Show command lists and command-specific help. |
Global options mirror the broader gruff CLI surface: --silent, --quiet, --version, --ansi / --no-ansi, --no-interaction, and --verbose.
analyse --format <fmt> accepts:
| Format | Use it for |
|---|---|
text |
Human terminal output. |
json |
Full gruff.analysis.v3 report. |
html |
Self-contained inspection report. |
markdown |
Pull-request or issue comment summary. |
github |
GitHub Actions workflow annotations. |
hotspot |
gruff-py.hotspot.v1 file-offender JSON. |
sarif |
SARIF 2.1.0 for code scanning. |
report --format <fmt> accepts html and json.
| Code | Meaning |
|---|---|
0 |
Run completed and no finding met --fail-on. |
1 |
At least one finding met --fail-on. |
2 |
Fatal diagnostic such as input, parse, configuration, baseline, or diff failure. |
--fail-on gates findings only. A parse error is a fatal diagnostic and exits
2 even with --fail-on none; none makes findings report-only, not
diagnostics.
analyse defaults to --fail-on advisory. Set
failOn.analyse in .gruff-py.yaml to change the default
per-project (see docs/configuration.md).
Generic CI command:
uv run gruff-py analyse src tests --format github --fail-on warning
SARIF jobs can write an artifact for code scanning:
uv run gruff-py analyse src tests --format sarif --fail-on none > gruff-py.sarif
Use --no-baseline on security gates, so a finding already recorded in the adoption baseline still fails the run.
Config is optional. Precedence is:
--config <path>.gruff-py.yaml in the project root[tool.gruff-py] in pyproject.tomlExample .gruff-py.yaml:
schemaVersion: gruff-py.config.v0.1
paths:
ignore:
- "tests/fixtures/**"
selection:
excludeRules:
- docs.missing-module-docstring
rules:
size.file-length:
threshold: 900
severity: error
See Configuration for the full shape.
docs/rules.md is generated from RuleRegistry.defaults() and lists every rule ID, pillar, default, and remediation note. Check that the committed copy is current without rewriting it:
uv run python -m gruffpy.command.rule_docs --check docs/rules.md
coupling, architecture, and mutation are reserved schema names with no shipping rules in 0.6.0. modernisation and maintainability lost their last rules in 0.6.0 but still count toward the composite, scoring 100 whenever files are evaluated.
Baselines suppress reviewed findings by a line-free identity and a count, so an unrelated edit that shifts line numbers does not re-open reviewed debt:
uv run gruff-py analyse src/ --generate-baseline --fail-on none
uv run gruff-py analyse src/ --baseline gruff-baseline.json --fail-on warning
uv run gruff-py analyse src/ --no-baseline --fail-on none
Changed-code scans are changed-region aware: a finding is kept when its location
or enclosing function/class overlaps the changed hunk. JSON output reports the
findings excluded as out of scope at summary.suppressedFindings and
diff.filteredFindings.
uv run gruff-py analyse --format json --changed-ranges "3-3,8-10" src/foo.py
uv run gruff-py analyse --format json --since HEAD src/foo.py
git diff | uv run gruff-py analyse --format json --diff - src/foo.py
Narrow path scans that leave project-wide rules enabled include a partial-context caveat in JSON run metadata and text output because conclusions can differ from a full-project scan.
--exclude-rule, --include-rule, --exclude-pillar, and --include-pillar are execution-level:
the excluded rules do not run, so the score and the exit code move with them. Display filters such as
--min-severity, --hide-rule, and --show-rule reduce rendered analyse output without changing
which rules execute, the score, or the exit code. Text output discloses when findings are hidden by
these filters.
uv run gruff-py dashboard src/ --host 127.0.0.1 --port 8765 --report-interactive
The dashboard serves a local browser UI for repeated scans. It has no
authentication and is intended for local development. Non-loopback hosts are
refused unless you pass --allow-public; that acknowledgment warns that remote
users can scan any directory readable by the server process. See
Dashboard for supported controls and safety notes.
In polyglot repositories, gruff-go, gruff-php, and gruff-py all default to port 8765 (gruff-rs uses 8766 and gruff-ts 8767); pass --port when running several dashboards at once.
Default scans are local source inspections. gruff-py parses Python source and selected project metadata; it does not execute target application code, run tests, query vulnerability feeds, or contact package registries. Git is used only for explicit diff modes. External mutation tooling is used only when explicitly requested by mutation flags. Sensitive-data previews are redacted before they reach terminal, JSON, SARIF, GitHub, Markdown, hotspot, or HTML output.
Through the 0.x line, rule IDs, finding fingerprints, baseline identity, gruff.analysis.v3, gruff.summary.v3, gruff.baseline.v3, gruff-py.hotspot.v1, gruff.hook.v2, SARIF rendering, and CLI exit semantics are compatibility-sensitive. Before 1.0, a minor bump (such as 0.5.x to 0.6.0) may break them; every break carries a BREAKING: marker and a migration path in CHANGELOG.md, and UPGRADING.md explains how to migrate or pin back.
| Tool | Relationship |
|---|---|
ruff |
Fast linting and formatting. gruff-py adds scoring, baselines, reports, dashboard, and project-quality rules. |
mypy / Pyright |
Type checking. gruff-py does not prove type correctness. |
pytest |
Runtime tests. gruff-py can flag test-quality smells but does not prove behavior. |
| Bandit / Semgrep / vulnerability scanners | Security-focused checks. gruff-py reports local static signals and does not replace specialized scanners. |
| Vulture / dead-code tools | Focused unused-code detection. gruff-py includes broader quality scoring and reporting. |
uv sync --extra dev
uv run ruff check src tests
uv run ruff format --check src tests
uv run mypy src
uv run pytest
make check
make check uses the lint target, which runs ruff check --fix. Use the explicit commands above when you need non-mutating release verification.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.