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, Nov 19, 2:40 PM
Unknown Object (File)
Oct 9 2024, 9:38 PM
Unknown Object (File)
Oct 9 2024, 9:37 PM
Unknown Object (File)
Oct 9 2024, 9:22 PM
Unknown Object (File)
Oct 7 2024, 5:13 PM
Unknown Object (File)
Sep 29 2024, 3:33 AM
Unknown Object (File)
Sep 23 2024, 2:38 AM
Unknown Object (File)
Sep 21 2024, 9:14 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)) {