Page MenuHomePhabricator

Add ansible-lint support
AbandonedPublic

Authored by michel-slm on Feb 18 2015, 5:41 AM.

Details

Summary

Uses ansible-lint to check Ansible playbooks for practices
and behaviour that could potentially be improved.

Test Plan

{

"linters": {
  "playbooks": {
    "type": "ansible-lint",
    "include": "(\\.yml$)"
  }
}

}

  • arc lint --everything. Verify that the output tallies with running ansible-lint directly

Diff Detail

Repository
rARC Arcanist
Branch
T7293
Lint
Lint OK
Unit
Unit Test Errors
Build Status
Buildable 4532
Build 4546: [Placeholder Plan] Wait for 30 Seconds

Unit TestsFailed

Excuse: Error is for an unrelated test case
TimeTest
605 msArcanistLesscLinterTestCase::testLinter
179 msArcanistChmodLinterTestCase::testLinter
0 msArcanistClosureLinterTestCase::testVersion
26 msArcanistCommitLinterTestCase::testLinter
0 msArcanistCpplintLinterTestCase::testVersion
View Full Test Results (1 Failed · 31 Passed · 22 Skipped)

Event Timeline

michel-slm retitled this revision from to Add ansible-lint support.
michel-slm updated this object.
michel-slm edited the test plan for this revision. (Show Details)
michel-slm added a reviewer: epriestley.
michel-slm updated this revision to Diff 28439.
joshuaspence edited edge metadata.May 5 2015, 9:04 AM
joshuaspence requested changes to this revision.
joshuaspence added inline comments.
src/lint/linter/ArcanistAnsibleLintLinter.php
13–15

Prefer to write this as pht('Uses `%s` to check Ansible playbooks for practices and behaviour that could potentially be improved.', 'ansible-lint').

Also, use US English (so "behavior" instead of "behaviour").

19

These are conventionally uppercase, so perhaps ANSIBLE?

30–34

Remove commented-out code.

36–38

Prefer to write this as pht('Install ansible-lint using `%s`.', 'pip install ansible-lint').

40–42

This is the default implementation, don't bother implementing this explicitly.

45–54

Drop this.

63

Stray debugging code?

70–76

This pull request has been merged, so presumably this code can be activated now?

81

Don't set a character offset if it's wrong.

86–87

Remove commented out code

88

Prefer to use getLintMessageSeverity so that the severity is customizable.

This revision now requires changes to proceed.May 5 2015, 9:04 AM

Thanks for the feedback -- and apologies for the delay in responding, the notification email got stuck in one of my spam filters.

michel-slm marked 11 inline comments as done.Dec 4 2015, 4:32 AM
michel-slm abandoned this revision.

Re-implemented this in D14662 (incorporating @joshuaspence's suggestions).