Skip to content

Commit 5bfbb36

Browse files
committed
Lint
1 parent 3167e94 commit 5bfbb36

4 files changed

Lines changed: 36 additions & 30 deletions

File tree

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
black>=21.5b1,<22.1.0
1+
black<22.1.0,>=21.5b1
22
domdf-python-tools>=2.9.1
33
formate>=0.4.4

tests/test_format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def test_experimental_format(self, filename: str) -> None:
102102
self.check_file(
103103
filename,
104104
black.Mode(experimental_string_processing=True),
105-
kwargs=dict(experimental_string_processing=True)
105+
kwargs=dict(experimental_string_processing=True),
106106
)
107107

108108
@parameterized.expand(SOURCES)

tests/test_formate_black.py

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -108,40 +108,46 @@ def test_python39() -> None:
108108
black.assert_stable(source, actual, DEFAULT_MODE)
109109

110110

111-
@pytest.mark.parametrize("contents_tab, contents_spc", [
112-
(
113-
"if 1:\n\tif 2:\n\t\tpass\n\t# comment\n\tpass\n",
114-
"if 1:\n if 2:\n pass\n # comment\n pass\n"),
115-
(
116-
"if 1:\n\tif 2:\n\t\tpass\n\t\t# comment\n\tpass\n",
117-
"if 1:\n if 2:\n pass\n # comment\n pass\n"),
118-
( # mixed tabs and spaces (valid Python 2 code)
119-
"if 1:\n if 2:\n\t\tpass\n\t# comment\n pass\n",
120-
"if 1:\n if 2:\n pass\n # comment\n pass\n",
121-
),
122-
(
123-
"if 1:\n if 2:\n\t\tpass\n\t\t# comment\n pass\n",
124-
"if 1:\n if 2:\n pass\n # comment\n pass\n",
125-
),
126-
])
111+
@pytest.mark.parametrize(
112+
"contents_tab, contents_spc", [
113+
(
114+
"if 1:\n\tif 2:\n\t\tpass\n\t# comment\n\tpass\n",
115+
"if 1:\n if 2:\n pass\n # comment\n pass\n",
116+
),
117+
(
118+
"if 1:\n\tif 2:\n\t\tpass\n\t\t# comment\n\tpass\n",
119+
"if 1:\n if 2:\n pass\n # comment\n pass\n",
120+
),
121+
( # mixed tabs and spaces (valid Python 2 code)
122+
"if 1:\n if 2:\n\t\tpass\n\t# comment\n pass\n",
123+
"if 1:\n if 2:\n pass\n # comment\n pass\n",
124+
),
125+
(
126+
"if 1:\n if 2:\n\t\tpass\n\t\t# comment\n pass\n",
127+
"if 1:\n if 2:\n pass\n # comment\n pass\n",
128+
),
129+
],
130+
)
127131
def test_tab_comment_indentation(contents_tab: str, contents_spc: str) -> None:
128132
assert contents_spc == black_hook(contents_spc, formate_filename="code.py")
129133
assert contents_spc == black_hook(contents_tab, formate_filename="code.py")
130134
assert contents_spc == black_hook(contents_spc, formate_filename="code.py", use_tabs=False)
131135
assert contents_spc == black_hook(contents_tab, formate_filename="code.py", use_tabs=False)
132136

133137

134-
@pytest.mark.parametrize("contents_tab, contents_spc", [
135-
(
136-
"if 1:\n\tif 2:\n\t\tpass\n\t# comment\n\tpass\n",
137-
"if 1:\n if 2:\n pass\n # comment\n pass\n",
138-
),
139-
(
140-
"if 1:\n\tif 2:\n\t\tpass\n\t\t# comment\n\tpass\n",
141-
"if 1:\n if 2:\n pass\n # comment\n pass\n",
142-
)
143-
144-
])
138+
@pytest.mark.parametrize(
139+
"contents_tab, contents_spc",
140+
[
141+
(
142+
"if 1:\n\tif 2:\n\t\tpass\n\t# comment\n\tpass\n",
143+
"if 1:\n if 2:\n pass\n # comment\n pass\n",
144+
),
145+
(
146+
"if 1:\n\tif 2:\n\t\tpass\n\t\t# comment\n\tpass\n",
147+
"if 1:\n if 2:\n pass\n # comment\n pass\n",
148+
),
149+
],
150+
)
145151
def test_tab_comment_indentation_use_tabs(contents_tab: str, contents_spc: str) -> None:
146152
assert contents_tab == black_hook(contents_spc, formate_filename="code.py", use_tabs=True)
147153
assert contents_tab == black_hook(contents_tab, formate_filename="code.py", use_tabs=True)

tests/test_formate_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def test_experimental_format(self, filename: str) -> None:
105105
self.check_file(
106106
filename,
107107
black.Mode(experimental_string_processing=True),
108-
kwargs=dict(experimental_string_processing=True)
108+
kwargs=dict(experimental_string_processing=True),
109109
)
110110

111111
@parameterized.expand(SOURCES)

0 commit comments

Comments
 (0)