Page MenuHomePhabricator

Add support for Ansible-Lint
Needs ReviewPublic

Authored by michel-slm on Dec 4 2015, 4:30 AM.
Tags
None
Referenced Files
F18617353: D14662.id35466.diff
Sep 14 2025, 8:59 PM
F18616040: D14662.id.diff
Sep 14 2025, 3:59 PM
F18615857: D14662.diff
Sep 14 2025, 3:18 PM
F18598839: D14662.diff
Sep 13 2025, 5:58 AM
F18597465: D14662.diff
Sep 13 2025, 2:56 AM
F18506718: D14662.id.diff
Sep 5 2025, 1:44 AM
F18499415: D14662.diff
Sep 4 2025, 7:44 PM
F18112723: D14662.id.diff
Aug 12 2025, 7:59 PM

Details

Reviewers
None
Group Reviewers
Blessed Reviewers
Maniphest Tasks
T7293: Add support for ansible-lint
Summary

This commit adds support for Ansible-Lint, using its PEP8-mode output for
easy parsing.

Unit tests are included for all the currently-supported lint checks.

Test Plan
pip install --user ansible-lint
cd src/lint/linters/__tests__/
arc unit ArcanistAnsibleLintLinterTestCase.php

Diff Detail

Repository
rARC Arcanist
Branch
ansible-lint
Lint
Lint Passed
SeverityLocationCodeMessage
Auto-Fixsrc/lint/linter/__tests__/ansible-lint/trailing_whitespace.lint-test:1TXT6Trailing Whitespace
Unit
Tests Passed
Build Status
Buildable 9277
Build 11004: arc lint + arc unit

Event Timeline

michel-slm retitled this revision from to Add support for Ansible-Lint.
michel-slm updated this object.
michel-slm edited the test plan for this revision. (Show Details)
michel-slm added a reviewer: joshuaspence.
michel-slm edited edge metadata.

I tried setting this up locally but arc lint isn't throwing warning when I hit a SEVERITY_WARNING from the ansible-lint. Is that a known issue to you @michel-slm or could it be that I'm doing something wrong?

src/lint/linter/ArcanistAnsibleLintLinter.php
82

I had to add brackets around the ANSIBLE0003 to get a proper match:

if (preg_match('/^\[ANSIBLE0003\]$/', $code)) {