Skip to content

Commit 843c247

Browse files
Charlie-XIAOmroeschke
authored andcommitted
CI: add empty line in no-bool-in-generic to avoid black complaining (pandas-dev#54855)
* black will complain if there is no additional empty line * also update the test
1 parent b2a0a24 commit 843c247

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

scripts/no_bool_in_generic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def replace_bool_with_bool_t(to_replace, content: str) -> str:
6565
+ replaced_line[col_offset + 4 :]
6666
)
6767
new_lines.append(replaced_line)
68-
return "\n".join(new_lines)
68+
return "\n".join(new_lines) + "\n"
6969

7070

7171
def check_for_bool_in_generic(content: str) -> tuple[bool, str]:

scripts/tests/test_no_bool_in_generic.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from scripts.no_bool_in_generic import check_for_bool_in_generic
22

3-
BAD_FILE = "def foo(a: bool) -> bool:\n return bool(0)"
4-
GOOD_FILE = "def foo(a: bool_t) -> bool_t:\n return bool(0)"
3+
BAD_FILE = "def foo(a: bool) -> bool:\n return bool(0)\n"
4+
GOOD_FILE = "def foo(a: bool_t) -> bool_t:\n return bool(0)\n"
55

66

77
def test_bad_file_with_replace():

0 commit comments

Comments
 (0)