Skip to content

Commit

Permalink
fix 4.0.1 to 4.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Kahn committed Apr 30, 2022
1 parent 2e51461 commit 2742206
Show file tree
Hide file tree
Showing 7 changed files with 205 additions and 235 deletions.
21 changes: 21 additions & 0 deletions LICENCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016 Joseph Kahn

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ available in ``flake8``::
Changes
-------

##### 4.1.0 - 2022-04-30

* Drop support for python 3.6 and remove special handling code.
* bundle licence file.

##### 4.0.0 - 2020-11-29

* Opted back into using Poetry now that the existing issues have been fixed.
Expand Down
9 changes: 3 additions & 6 deletions flake8_debugger.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Extension for flake8 that finds usage of the debugger."""
import ast
import sys
from itertools import chain

import pycodestyle
Expand All @@ -10,7 +9,7 @@
except ImportError:
from flake8 import utils as stdin_utils

__version__ = "4.0.0"
__version__ = "4.1.0"

DEBUGGER_ERROR_CODE = "T100"

Expand All @@ -21,11 +20,9 @@
"IPython.terminal.embed": ["InteractiveShellEmbed"],
"IPython.frontend.terminal.embed": ["InteractiveShellEmbed"],
"celery.contrib.rdb": ["set_trace"],
"builtins": ["breakpoint"]
}

if sys.version_info >= (3, 7):
debuggers["builtins"] = ["breakpoint"]


class DebuggerFinder(ast.NodeVisitor):
def __init__(self, *args, **kwargs):
Expand All @@ -39,7 +36,7 @@ def __init__(self, *args, **kwargs):
self.debuggers_imported = {}

def visit_Call(self, node):
if sys.version_info >= (3, 7) and getattr(node.func, "id", None) == "breakpoint":
if getattr(node.func, "id", None) == "breakpoint":
entry = self.debuggers_used.setdefault((node.lineno, node.col_offset), [])
entry.append("{0} trace found: breakpoint used".format(DEBUGGER_ERROR_CODE))

Expand Down
Loading

0 comments on commit 2742206

Please sign in to comment.