Repository navigation
Description
Summary
Add rtk ansible-lint to the built-in wrapper set. ansible-lint is one of the verbose linters that doesn't yet have an rtk filter, and like rtk lint (ESLint) and rtk rubocop, it benefits from rule-grouping + ANSI strip.
Sizing
Real-world frequency from a 30-day Claude Code window on an Ansible-heavy infra repo: 11 invocations flagged by rtk discover as unhandled. Each invocation against a non-trivial role tree produces 100-500 lines of output (per-task violations, with full file paths + 5+ line context blocks per finding), often with ANSI color.
Two representative invocations:
ansible-lint roles/ playbooks/
ansible-lint --offline -p
I checked the issue tracker and didn't find a prior request for this specific tool — closest neighbors are #1607/#1680/#789 (ssh) and #1737/#1738 (op/1Password CLI), which suggests linter wrappers for less-mainstream-but-still-common tools fit the project's direction.
Proposed shape
Pattern lifted from rtk lint (ESLint grouped output) and rtk rubocop:
- Strip ANSI escapes
- Strip the
WARNING: PATH altered to expand ~andAnsibleWarning: Enable tracemallocboilerplate that ansible-lint emits unconditionally - Group violations by rule-id (
yaml[indentation],var-naming,risky-shell-pipe, etc.) with a<rule-id>: <count>header line per group - Show the first N (e.g. 3) sample paths per rule-id, then a
… +K moreline - Preserve the final summary line (
Passed: 0 failure(s), 0 warning(s) …/Failed: …) verbatim — that's the signal an agent acts on - Pass-through mode for
--version,--help,-L(list rules),-T(list tags) — these have small fixed output and shouldn't be touched
Subcommand surface should mirror existing wrappers: rtk ansible-lint <args...> shells through to ansible-lint <args...> with the filter applied to stdout/stderr.
Why this fits the existing pattern
- The
rtk lintwrapper already does ESLint rule-grouping, so the heuristic exists in code. - ansible-lint output is structurally similar to ESLint's: file path, line:col, rule-id, message, optional context block.
- ansible-lint exit code semantics are the same as ESLint (0 = clean, non-0 = violations), so no special handling needed for
&&/||chains.
Verification
If an agent runs rtk ansible-lint roles/some-role/ on a tree with 30 violations spanning 5 rule-ids, expected compressed output is ~10 lines (rule-id headers + 3 sample paths each + summary), down from ~150 lines raw. Estimated savings: ~70% on a typical infra-repo lint pass, similar to the rtk lint baseline.
Out of scope for this issue (tracked separately upstream)
sshwrapper — already requested in Feature request: rtk wrapper for ssh remote commands #1607, Feature: SSH command filtering/proxying #1680, discover over-reports missed savings when PreToolUse hook is active #789, Feature request: filter forsshcommands #1708, Add subcommands for ssh and xcodebuild output filtering #1709 (and SSH filter passesverify(3/3) butrtk rewritereturns exit 1 — ssh commands unintercepted on Claude Code hook path #1654 tracking the rewrite-path bug for the existing ssh filter prototype). +1 from me on those rather than a duplicate here.rtk discoverundercounting hook-rewritten commands — already tracked in discover undercounts RTK adoption when commands are rewritten via PreToolUse hook #1643,rtk discoverreports false-positive missed savings for hook-rewritten commands #1441, rtk discover reports false negatives when hook-based rewriting is active #1055, rtk discover reports false positives - doesn't account for hook-rewritten commands #929, discover over-reports missed savings when PreToolUse hook is active #789.
Environment
- rtk 0.39.0 (just upgraded from 0.35.0; verified the parser fixes for
ps -p PID -o,pnpm install --frozen-lockfile,grep -q, andansible-playbook --syntax-checkall landed in 0.36-0.39, nice work) - ansible-lint 26.4.0 / ansible-core 2.20.5
- macOS arm64, brew install
Activity
pszymkowiak commentedon May 27, 2026
🔍 Automated Triage
featuremediumSummary
Well-specified request to add rtk ansible-lint wrapper with rule-grouping, ANSI stripping, and boilerplate suppression — follows the existing rtk lint/rtk rubocop pattern; no duplicate found in open issues.
Triaged automatically by wshm · This is an automated analysis, not a human review.