summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2017-01-28 09:56:25 +0100
committerAnthon van der Neut <anthon@mnt.org>2017-01-28 09:56:25 +0100
commit7c72a605d4c7a4c5049ebf78938984085e673ab8 (patch)
tree792d0c2caab1febbabdceccf7f3219f0afe38f3a
parent11007775fff4348df2f301b5082d1508a8d57804 (diff)
downloadruamel.yaml-7c72a605d4c7a4c5049ebf78938984085e673ab8.tar.gz
fix spurious comment line0.13.13
-rw-r--r--README.rst4
-rw-r--r--__init__.py2
-rw-r--r--_test/test_comments.py12
-rw-r--r--scanner.py1
4 files changed, 15 insertions, 4 deletions
diff --git a/README.rst b/README.rst
index c4803e4..23b5afa 100644
--- a/README.rst
+++ b/README.rst
@@ -18,9 +18,9 @@ ChangeLog
.. should insert NEXT: at the beginning of line for next key
-0.13.12 (2017-01-28):
+0.13.13 (2017-01-28):
- fix for issue 96: prevent insertion of extra empty line if indented mapping entries
- are separated by an empty line. Reported by Derrick Sawyer
+ are separated by an empty line (reported by Derrick Sawyer)
0.13.11 (2017-01-23):
- allow ':' in flow style scalars if not followed by space. Also don't
diff --git a/__init__.py b/__init__.py
index 117b8ea..43d8683 100644
--- a/__init__.py
+++ b/__init__.py
@@ -8,7 +8,7 @@ from __future__ import print_function, absolute_import, division, unicode_litera
_package_data = dict(
full_package_name="ruamel.yaml",
- version_info=(0, 13, 12),
+ version_info=(0, 13, 13),
author="Anthon van der Neut",
author_email="a.van.der.neut@ruamel.eu",
description="ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order", # NOQA
diff --git a/_test/test_comments.py b/_test/test_comments.py
index 7673094..78daa5e 100644
--- a/_test/test_comments.py
+++ b/_test/test_comments.py
@@ -670,6 +670,18 @@ class TestEmptyLines:
- c2: catfish
""")
+ def test_issue_96(self):
+ # inserted extra line on trailing spaces
+ round_trip("""\
+ a:
+ b:
+ c: c_val
+ d:
+
+ e:
+ g: g_val
+ """)
+
class TestUnicodeComments:
@pytest.mark.skipif(ruamel.yaml.reader.Reader.UNICODE_SIZE < 4,
diff --git a/scanner.py b/scanner.py
index a925fc3..95e9d0a 100644
--- a/scanner.py
+++ b/scanner.py
@@ -1601,7 +1601,6 @@ class RoundTripScanner(Scanner):
# empty line within indented key context
# no need to update end-mark, that is not used
value = value[:-1]
- print('comment', repr(value))
self.tokens.append(CommentToken(value, start_mark, end_mark))
# scanner