forked from coala/coala-bears
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes coala#825
- Loading branch information
srisankethu
committed
Nov 12, 2016
1 parent
c1cd381
commit 3b1316a
Showing
3 changed files
with
45 additions
and
1 deletion.
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,29 @@ | ||
from coalib.bearlib.abstractions.Linter import linter | ||
from coalib.bears.requirements.PipRequirement import PipRequirement | ||
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY | ||
|
||
|
||
@linter(executable='pyflakes', | ||
output_format='regex', | ||
output_regex=r'(?P<filename>.*):(?P<line>.*):\s*' | ||
r'(?P<severity>)\s(?P<message>.*)', | ||
severity_map={ | ||
'': RESULT_SEVERITY.INFO | ||
}) | ||
class PyFlakesBear: | ||
""" | ||
Checks Python files for logistic errors using ``pyflakes``. | ||
See https://github.com/PyCQA/pyflakes for more info. | ||
""" | ||
LANGUAGES = {"Python", "Python 3"} | ||
REQUIREMENTS = {PipRequirement('pyflakes', '1.2.*')} | ||
AUTHORS = {'The coala developers'} | ||
AUTHORS_EMAILS = {'[email protected]'} | ||
LICENSE = 'AGPL-3.0' | ||
ASCIINEMA_URL = 'https://asciinema.org/a/92503' | ||
CAN_DETECT = {'Syntax', 'Unused imports', 'Undefined Element'} | ||
|
||
@staticmethod | ||
def create_arguments(filename, file, config_file): | ||
return filename, |
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
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,15 @@ | ||
from bears.python.PyFlakesBear import PyFlakesBear | ||
from tests.LocalBearTestHelper import verify_local_bear | ||
|
||
good_file = """ | ||
print("Hi") | ||
""" | ||
|
||
bad_file = """ | ||
import os | ||
print("Hi") | ||
""" | ||
|
||
PyFlakesBear = verify_local_bear(PyFlakesBear, | ||
valid_files=(good_file,), | ||
invalid_files=(bad_file,)) |