-
Notifications
You must be signed in to change notification settings - Fork 581
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PlanemoLintBear.py: Add linter bear for planemo
Added a linter bear for planemo lint Used `planemo lint` command Closes #1321
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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,) |