Page MenuHomePhabricator

Add support for Ansible-Lint
Needs ReviewPublic

Authored by michel-slm on Dec 4 2015, 4:30 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jan 21, 4:02 PM
Unknown Object (File)
Tue, Jan 21, 12:36 PM
Unknown Object (File)
Fri, Jan 17, 1:28 PM
Unknown Object (File)
Wed, Jan 15, 7:37 PM
Unknown Object (File)
Wed, Jan 15, 10:45 AM
Unknown Object (File)
Fri, Jan 3, 2:05 PM
Unknown Object (File)
Fri, Dec 27, 6:35 AM
Unknown Object (File)
Thu, Dec 26, 5:23 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 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)) {