Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

key-duplicates: Fix failing test for missing space after colon #479

Merged
merged 1 commit into from Jul 8, 2022

Commits on Jul 8, 2022

  1. key-duplicates: Fix failing test for missing space after colon

    Commit c268a82 "key-duplicates: Don't crash on redundant closing
    brackets or braces" fixed a problem but introduced another one: it
    crashes on systems with (I guess) an old version of PyYAML. This is
    probably linked to the "Allow colon in a plain scalar in a flow context"
    issue on PyYAML [1].
    For example, this problem happens on CentOS 8:
    
        FAIL: test_disabled (tests.rules.test_key_duplicates.KeyDuplicatesTestCase)
        ----------------------------------------------------------------------
        Traceback (most recent call last):
          File "…/tests/rules/test_key_duplicates.py", line 90, in test_disabled
            '{a:1, b:2}}\n', conf, problem=(2, 11, 'syntax'))
          File "…/tests/common.py", line 54, in check
            self.assertEqual(real_problems, expected_problems)
        AssertionError: Lists differ: …
        - [2:3: syntax error: found unexpected ':' (syntax)]
        + [2:11: <no description>]
    
    I propose to simply fix the *space following a colon* problem, since
    it's not related to what the original author @tamere-allo-peter tried to
    fix.
    
    [1]: yaml/pyyaml#45
    adrienverge committed Jul 8, 2022
    Configuration menu
    Copy the full SHA
    0e09430 View commit details
    Browse the repository at this point in the history