Skip to content

Commit

Permalink
PlanemoLintBear.py: Add linter bear for planemo
Browse files Browse the repository at this point in the history
Added a linter bear for planemo lint
Used `planemo lint` command

Closes #1321
  • Loading branch information
Shade5 committed Jan 22, 2017
1 parent e20e679 commit 99b18fd
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions bears/planemo/PlanemoLintBear.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import os
import shlex

from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.PipRequirement import PipRequirement
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
from coalib.settings.Setting import typed_list


@linter(executable='planemo',
output_format='regex',
output_regex=r'..\s(?P<severity>\w*:)(?P<message>.*)',
severity_map={'WARNING:': RESULT_SEVERITY.MAJOR,
'CHECK:': RESULT_SEVERITY.NORMAL,
'INFO:': RESULT_SEVERITY.INFO})
class PlanemoLintBear:
"""
Checks the code with pylint. This will run pylint over each file
separately.
"""
LANGUAGES = {'Python', 'Python 2', 'Python 3'}
REQUIREMENTS = {PipRequirement('pylint', '1.6')}
AUTHORS = {'The coala developers'}
AUTHORS_EMAILS = {'[email protected]'}
LICENSE = 'AGPL-3.0'
CAN_DETECT = {'Unused Code', 'Formatting', 'Duplication', 'Security',
'Syntax'}

@staticmethod
def create_arguments(filename, file, config_file,):
"""
:param pylint_disable: Disable the message, report, category or
checker with the given id(s).
:param pylint_enable: Enable the message, report, category or
checker with the given id(s).
:param pylint_cli_options: Any command line options you wish to be
passed to pylint.
:param pylint_rcfile: The rcfile for PyLint.
"""
args = ('lint',)

return args + (filename,)

0 comments on commit 99b18fd

Please sign in to comment.