Skip to content

Commit

Permalink
Fix #565 check_prints sees nested pkdp (#566)
Browse files Browse the repository at this point in the history
  • Loading branch information
robnagler authored Feb 24, 2025
1 parent 176bbf9 commit 79511e4
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pykern/pkcli/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
)

_MAIN = re.compile(r"^if.*__name__")
_PRINT = re.compile(r"(?:\s|^)(?:pkdp|print)\(")
_PRINT = re.compile(r"(?:[\s\(,]|^)(?:pkdp|print)\(")
_PRINT_OK = re.compile(r"^\s*#\s*(?:pkdp|print)\(")


Expand Down
1 change: 1 addition & 0 deletions tests/pkcli/ci_data/check_prints-1.in/x.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ def checking_prints_at_function_level():
pkdp("this pkdp should be found")
print("this print should be found")
"#" + print("should be found")
int(pkdp(1))
1 change: 1 addition & 0 deletions tests/pkcli/ci_data/check_prints-1.out/pkexcept
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
check_prints: x.py:4 pkdp("this pkdp should be found")
x.py:5 print("this print should be found")
x.py:6 "#" + print("should be found")
x.py:7 int(pkdp(1))
2 changes: 0 additions & 2 deletions tests/pkcli/ci_test.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# -*- coding: utf-8 -*-
"""test ci
:copyright: Copyright (c) 2022 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from pykern.pkdebug import pkdp


def test_all():
Expand Down

0 comments on commit 79511e4

Please sign in to comment.