Rules: indentation: Handle sets

Sets are like mappings, that do not contain values. Example:

    set:
      ? key one
      ? key two
      ? [non, scalar, key]
This commit is contained in:
Adrien Vergé
2016-02-01 17:52:46 +01:00
parent 431a379c81
commit 68618be4cc
3 changed files with 27 additions and 2 deletions

View File

@@ -75,3 +75,20 @@ class YamlLintTestCase(RuleTestCase):
' Atlanta Braves]\n'
': [2001-07-02, 2001-08-12,\n'
' 2001-08-14]\n', None)
def test_sets(self):
self.check('---\n'
'? key one\n'
'? key two\n'
'? [non, scalar, key]\n'
'? key with value\n'
': value\n'
'...\n', None)
self.check('---\n'
'? - multi\n'
' - line\n'
' - keys\n'
'? in:\n'
' a:\n'
' set\n'
'...\n', None)