Skip to content

Commit

Permalink
attempt to fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph committed Jun 30, 2014
1 parent 767a09f commit a9bd30b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
18 changes: 10 additions & 8 deletions flake8_debugger.py
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__
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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=[
Expand Down

0 comments on commit a9bd30b

Please sign in to comment.