mypy: Turn on return value checks

Its a shame GvR is married to "return None"
https://github.com/python/mypy/issues/7511
This commit is contained in:
Kovid Goyal
2021-10-26 22:39:14 +05:30
parent 5cb36a4632
commit 4494ddd8ff
52 changed files with 124 additions and 49 deletions
+1
View File
@@ -69,6 +69,7 @@ def idx_for_id(win_id: int, windows: Iterable[WindowType]) -> Optional[int]:
for i, w in enumerate(windows):
if w.id == win_id:
return i
return None
def set_layout_options(opts: Options) -> None:
+1
View File
@@ -81,6 +81,7 @@ class Grid(Layout):
if idx == window_idx:
return row_num, col_num
row_num += 1
return 0, 0
row_num, col_num = position_for_window_idx(idx)
+2
View File
@@ -86,6 +86,7 @@ class Pair:
for q in root.self_and_descendants():
if q.one is self or q.two is self:
return q
return None
def remove_windows(self, window_ids: Collection[int]) -> None:
if isinstance(self.one, int) and self.one in window_ids:
@@ -548,6 +549,7 @@ class Splits(Layout):
if swap:
pair.one, pair.two = pair.two, pair.one
return True
return None
def layout_state(self) -> Dict[str, Any]:
+1
View File
@@ -203,6 +203,7 @@ class Tall(Layout):
if self.layout_opts.full_size > 1:
self.layout_opts.full_size -= 1
return True
return None
def minimal_borders(self, all_windows: WindowList) -> Generator[BorderLine, None, None]:
num = all_windows.num_groups