Skip to content

Commit

Permalink
CI: add empty line in no-bool-in-generic to avoid black complaini…
Browse files Browse the repository at this point in the history
…ng (#54855)

* black will complain if there is no additional empty line

* also update the test
  • Loading branch information
Charlie-XIAO authored Aug 31, 2023
1 parent 6884d1c commit 1e482de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/no_bool_in_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def replace_bool_with_bool_t(to_replace, content: str) -> str:
+ replaced_line[col_offset + 4 :]
)
new_lines.append(replaced_line)
return "\n".join(new_lines)
return "\n".join(new_lines) + "\n"


def check_for_bool_in_generic(content: str) -> tuple[bool, str]:
Expand Down
4 changes: 2 additions & 2 deletions scripts/tests/test_no_bool_in_generic.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from scripts.no_bool_in_generic import check_for_bool_in_generic

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


def test_bad_file_with_replace():
Expand Down

0 comments on commit 1e482de

Please sign in to comment.