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:
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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]:
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user