Page MenuHomePhabricator

Add support for Ansible-Lint
Needs ReviewPublic

Authored by michel-slm on Dec 4 2015, 4:30 AM.
Tags
None
Referenced Files
F12832962: D14662.diff
Thu, Mar 28, 1:43 PM
Unknown Object (File)
Thu, Mar 21, 6:46 AM
Unknown Object (File)
Thu, Mar 21, 3:23 AM
Unknown Object (File)
Wed, Mar 20, 11:12 PM
Unknown Object (File)
Wed, Mar 20, 6:19 PM
Unknown Object (File)
Thu, Mar 7, 6:04 AM
Unknown Object (File)
Tue, Mar 5, 7:04 PM
Unknown Object (File)
Feb 18 2024, 12:40 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)) {