Skip to content

Commit 5fe2825

Browse files
committed
Linting
1 parent 5ea4029 commit 5fe2825

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

coverage_pyver_pragma/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ def configure(self, config: Any) -> None:
153153
# print(config.exclude_list)
154154

155155
# Reinstate the general regex, but making sure it isn't followed by a left bracket.
156-
config.exclude_list.append(make_not_exclude_regex(platform.system(), platform.python_implementation()).pattern)
156+
config.exclude_list.append(
157+
make_not_exclude_regex(platform.system(), platform.python_implementation()).pattern
158+
)
157159

158160
# TODO: Python 4.X
159161

@@ -164,8 +166,8 @@ def make_not_exclude_regex(
164166
) -> Pattern:
165167

166168
return re.compile(
167-
fr"{regex_main} (?!\(.*(.{{0,2}}(py|PY|Py)3\d(\+)?|!{current_platform}|!{current_implementation}).*\)).*$"
168-
)
169+
fr"{regex_main} (?!\(.*(.{{0,2}}(py|PY|Py)3\d(\+)?|!{current_platform}|!{current_implementation}).*\)).*$"
170+
)
169171

170172

171173
def coverage_init(reg, options):

tests/test_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys
44

55
# this package
6-
from coverage_pyver_pragma import make_not_exclude_regex, PyVerPragmaPlugin, make_regexes, regex_main
6+
from coverage_pyver_pragma import PyVerPragmaPlugin, make_not_exclude_regex, make_regexes, regex_main
77

88

99
class MockConfig:

tests/test_regex.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ def test_not_version_regex():
2323
for no_string in ["no", "NO"]:
2424
for post_no_space in ['', ' ', "\t", " "]:
2525
for cover_string in ["cover", "COVER"]:
26-
for post_cover_space in [' ']: # ['', ' ', "\t", " "]: # TODO: This regex is picky about the space here
26+
for post_cover_space in [' ']:
27+
# ['', ' ', "\t", " "]: # TODO: This regex is picky about the space here
2728
for pre_version_sign in ['>', '<', ">=", "<=", '']:
2829
for py_string in ["Py", "PY", "py"]:
2930
for version in [30, 31, 32, 33, 34, 35, 36, 37, 38, 39]:
@@ -43,7 +44,8 @@ def test_not_version_regex():
4344
for no_string in ["no", "NO"]:
4445
for post_no_space in ['', ' ', "\t", " "]:
4546
for cover_string in ["cover", "COVER"]:
46-
for post_cover_space in [' ']: # ['', ' ', "\t", " "]: # TODO: This regex is picky about the space here
47+
for post_cover_space in [' ']:
48+
# ['', ' ', "\t", " "]: # TODO: This regex is picky about the space here
4749
for post_cover_text in ['', "abcdefg", "hello world"]:
4850
test_string = f"{comment_string}{pragma_string}{post_pragma_space}{no_string}{post_no_space}{cover_string}{post_cover_space}{post_cover_text}"
4951
# print(f"[{counter} TESTING: {test_string}]")

0 commit comments

Comments
 (0)