Skip to content

Commit 8215312

Browse files
committed
add new regex
1 parent 0e93be0 commit 8215312

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pre_commit_hooks/tests_should_end_in_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ def main(argv: Sequence[str] | None = None) -> int:
1414
'--pytest',
1515
dest='pattern',
1616
action='store_const',
17-
const=r'tests/.*/tests_*\.py',
18-
default=r'tests/.*/tests_*\.py',
17+
const=r'^tests\/(?:[a-zA-Z0-9_]+\/)*tests[a-zA-Z0-9_]*\.py$',
18+
default=r'^tests\/(?:[a-zA-Z0-9_]+\/)*tests[a-zA-Z0-9_]*\.py$',
1919
help='(the default) ensure tests match %(const)s',
2020
)
2121
args = parser.parse_args(argv)

0 commit comments

Comments
 (0)