From 080bc374cde1bcc5e1dc8ad9db1af5bc59a5a106 Mon Sep 17 00:00:00 2001 From: Brad Solomon Date: Tue, 28 Apr 2020 14:13:08 -0400 Subject: [PATCH] Addt'l test case for GH Issue #171 If we find a CRLF when looking for Unix newlines, yamllint should always raise, regardless of logic with require-starting-space. --- tests/rules/test_new_lines.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/rules/test_new_lines.py b/tests/rules/test_new_lines.py index a76d608..23f2957 100644 --- a/tests/rules/test_new_lines.py +++ b/tests/rules/test_new_lines.py @@ -40,6 +40,16 @@ class NewLinesTestCase(RuleTestCase): self.check('---\ntext\n', conf) self.check('---\r\ntext\r\n', conf, problem=(1, 4)) + def test_unix_type_required_st_sp(self): + # If we find a CRLF when looking for Unix newlines, yamllint + # should always raise, regardless of logic with + # require-starting-space. + conf = ('new-line-at-end-of-file: disable\n' + 'new-lines: {type: unix}\n' + 'comments:\n' + ' require-starting-space: true\n') + self.check('---\r\n#\r\n', conf, problem=(1, 4)) + def test_dos_type(self): conf = ('new-line-at-end-of-file: disable\n' 'new-lines: {type: dos}\n')