Page MenuHomePhabricator

Add support for Ansible-Lint
Needs ReviewPublic

Authored by michel-slm on Dec 4 2015, 4:30 AM.

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 OK
SeverityLocationCodeMessage
Auto-Fixsrc/lint/linter/__tests__/ansible-lint/trailing_whitespace.lint-test:1TXT6Trailing Whitespace
Unit
Unit Tests OK
Build Status
Buildable 9277
Build 11004: arc lint + arc unit

Event Timeline

michel-slm retitled this revision from to Add support for Ansible-Lint.Dec 4 2015, 4:30 AM
michel-slm updated this object.
michel-slm edited the test plan for this revision. (Show Details)
michel-slm added a reviewer: joshuaspence.
michel-slm updated this revision to Diff 35466.
michel-slm edited the test plan for this revision. (Show Details)Dec 9 2015, 4:11 AM
michel-slm edited edge metadata.
michel-slm added a subscriber: joshuaspence.
tomdev added a subscriber: tomdev.Feb 24 2016, 11:22 AM

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)) {

aubort added a subscriber: aubort.Dec 29 2016, 1:32 PM