+class _IBSEmitter(yaml.emitter.Emitter):
+
+ """Override the default YAML Emitter to indent block sequences."""
+
+ def expect_block_sequence(self):
+ """Match the expectations of the ``yamllint`` style checker."""
+
+ # TODO(fungi) Get an option for this implemented upstream in
+ # the pyyaml library
+ self.increase_indent(flow=False, indentless=False)
+ self.state = self.expect_first_block_sequence_item
+
+
+class _IBSDumper(yaml.SafeDumper, _IBSEmitter):
+
+ """Use our _IBSEmitter instead of the default implementation."""
+
+ pass
+
+