-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Joseph
committed
Jun 30, 2014
1 parent
767a09f
commit a9bd30b
Showing
2 changed files
with
13 additions
and
11 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 |
---|---|---|
@@ -1,16 +1,18 @@ | ||
import pep8 | ||
import re | ||
|
||
__version__ = '1.0' | ||
__version__ = '1.1' | ||
|
||
DEBUGGER_REGEX = re.compile(r'(import i?pdb|i?pdb.set_trace())') | ||
|
||
def check_for_debugger(line_of_code): | ||
if pep8.noqa(line_of_code): | ||
|
||
def check_debug_statements(physical_line): | ||
if pep8.noqa(physical_line): | ||
return | ||
debug_match = DEBUGGER_REGEX.search(line_of_code) | ||
if debug_match: | ||
return debug_match.start(), 'T000 pdb/ipdb found.' | ||
match = DEBUGGER_REGEX.search(physical_line) | ||
if match: | ||
return match.start(), 'T000 pdb/ipdb found.' | ||
|
||
|
||
check_for_debugger.name = name = 'flake8-debugger' | ||
check_for_debugger.version = __version__ | ||
check_debug_statements.name = name = 'flake8-debugger' | ||
check_debug_statements.version = __version__ |
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 |
---|---|---|
|
@@ -22,9 +22,9 @@ def get_long_description(): | |
setup( | ||
name='flake8-debugger', | ||
version=get_version(), | ||
description="pdb and ipdb statement checker plugin for flake8", # noqa | ||
description="pdb and ipdb checker plugin for flake8", | ||
long_description=get_long_description(), | ||
keywords='flake8 debugger ipdb pdb', | ||
keywords='flake8 debigger ipdb pdb', | ||
author='Joseph Kahn', | ||
author_email='[email protected]', | ||
url='https://github.com/jbkahn/flake8-debugger', | ||
|
@@ -33,7 +33,7 @@ def get_long_description(): | |
zip_safe=False, | ||
entry_points={ | ||
'flake8.extension': [ | ||
'flake8_debugger = flake8_debugger:check_for_debugger', | ||
'flake8_debugger = flake8_debugger:check_debug_statements', | ||
], | ||
}, | ||
classifiers=[ | ||
|