summaryrefslogtreecommitdiff
path: root/emitter.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2021-12-26 16:05:10 +0100
committerAnthon van der Neut <anthon@mnt.org>2021-12-26 16:05:10 +0100
commite3439a8768e067134385cb2ad4746e9dcbcb851a (patch)
tree198b6de9ae5ffe1c7baa10f660add34354c76eab /emitter.py
parent1dd3366f57e1feff1aa2aeb01142b63520bac0a1 (diff)
downloadruamel.yaml-e3439a8768e067134385cb2ad4746e9dcbcb851a.tar.gz
fix mypy issues emitter.py0.17.19
Diffstat (limited to 'emitter.py')
-rw-r--r--emitter.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/emitter.py b/emitter.py
index b66cffa..06de29c 100644
--- a/emitter.py
+++ b/emitter.py
@@ -74,7 +74,7 @@ class Indents:
return False
def seq_flow_align(self, seq_indent, column, pre_comment=False):
- # type: (int, int) -> int
+ # type: (int, int, Optional[bool]) -> int
# extra spaces because of dash
nprint('seq_flow_align', self.values, pre_comment)
if len(self.values) < 2 or not self.values[-1][1]:
@@ -82,10 +82,10 @@ class Indents:
return 0
base = self.values[-1][0] if self.values[-1][0] is not None else 0
if pre_comment:
- return base + seq_indent
+ return base + seq_indent # type: ignore
# return (len(self.values)) * seq_indent
# -1 for the dash
- return base + seq_indent - column - 1
+ return base + seq_indent - column - 1 # type: ignore
def __len__(self):
# type: () -> int
@@ -498,7 +498,7 @@ class Emitter:
# Flow sequence handlers.
def expect_flow_sequence(self, force_flow_indent=False):
- # type: (bool) -> None
+ # type: (Optional[bool]) -> None
if force_flow_indent:
self.increase_indent(flow=True, sequence=True)
ind = self.indents.seq_flow_align(self.best_sequence_indent, self.column,
@@ -554,7 +554,7 @@ class Emitter:
# Flow mapping handlers.
def expect_flow_mapping(self, single=False, force_flow_indent=False):
- # type: (Optional[bool]) -> None
+ # type: (Optional[bool], Optional[bool]) -> None
if force_flow_indent:
self.increase_indent(flow=True, sequence=False)
ind = self.indents.seq_flow_align(self.best_sequence_indent, self.column,