Page MenuHomePhabricator

Add ansible-lint support
AbandonedPublic

Authored by michel-slm on Feb 18 2015, 5:41 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 21, 11:24 AM
Unknown Object (File)
Thu, Mar 21, 3:23 AM
Unknown Object (File)
Wed, Mar 20, 10:35 PM
Unknown Object (File)
Wed, Mar 20, 6:19 PM
Unknown Object (File)
Feb 18 2024, 12:58 AM
Unknown Object (File)
Feb 10 2024, 9:47 AM
Unknown Object (File)
Jan 1 2024, 5:25 PM
Unknown Object (File)
Dec 28 2023, 4:41 PM

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 Passed
Unit
Test Failures
Build Status
Buildable 4532
Build 4546: [Placeholder Plan] Wait for 30 Seconds

Unit TestsFailed

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.
joshuaspence edited edge metadata.
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.

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