Skip to content

Commit

Permalink
WIP: Add AnsibleBear support
Browse files Browse the repository at this point in the history
Closes coala#794
  • Loading branch information
Sri Sanketh U committed Jul 16, 2017
1 parent c9be1bf commit 5c28625
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions bear-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
aenum~=2.0.8
ansible-lint~=3.4.12
apertium-lint~=0.29
autoflake~=0.6.6
autopep8~=1.2
Expand Down
25 changes: 25 additions & 0 deletions bears/configfiles/AnsibleLintBear.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.PipRequirement import PipRequirement


@linter(executable='ansible-lint',
output_format='regex',
output_regex=r'')
class AnsibleLintBear:
'''
Check and correct ansible playbooks using ``ansible-lint``.
See <https://github.com/willthames/ansible-lint/> for details about the tool.
'''

LANGUAGES = {'Ansible'}
REQUIREMENTS = {PipRequirement('ansible-lint', '3.4.12')}
AUTHORS = {'The coala developers'}
AUTHORS_EMAILS = {'[email protected]'}
LICENSE = 'AGPL-3.0'
ASCIINEMA_URL = ''
CAN_FIX = {'Syntax'}

@staticmethod
def create_arguments(filename, file):
return
12 changes: 12 additions & 0 deletions tests/configfiles/AnsibleLintBearTest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from bears.configfiles.AnsibleLintBear import AnsibleLintBear
from coalib.testing.LocalBearTestHelper import verify_local_bear

good_file = """
"""

bad_file = """
"""

PuppetLintBearTest = verify_local_bear(AnsibleLintBear,
valid_files=(good_file,),
invalid_files=(bad_file,))

0 comments on commit 5c28625

Please sign in to comment.