Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
pakrym-stripe committed Dec 7, 2023
1 parent 555e690 commit fc6393c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions flake8_stripe/flake8_stripe.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,15 @@ def __init__(self, tree: ast.AST, filename: str):
self.filename = filename

def run(self) -> Iterator[Tuple[int, int, str, type]]:
if not self.filename.split('/')[-1].startswith("_"):
if not self.filename.split("/")[-1].startswith("_"):
backcompat = False
for node in ast.walk(self.tree):
# check node is a constant string that contains package is deprecated
if (isinstance(node, ast.Constant)
if (
isinstance(node, ast.Constant)
and isinstance(node.value, str)
and "is deprecated" in node.value):
and "is deprecated" in node.value
):
backcompat = True

if not backcompat:
Expand Down

0 comments on commit fc6393c

Please sign in to comment.