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

Fix quoted-strings checks in flow maps and sequences #615

Merged
merged 1 commit into from
Nov 22, 2023

Commits on Nov 22, 2023

  1. quoted-strings: Fix only-when-needed in flow maps and sequences

    Flow maps and sequences need quotes if the values contain any of the
    flow tokens ({}, [], ','). However, yamllint generates false positives
    in these cases:
    
    $ yamllint -d 'rules: {quoted-strings: {required: only-when-needed}}' - <<<'field: ["string[bracket]"]'
      1:9       error    string value is redundantly quoted with any quotes  (quoted-strings)
    
    To fix this, track when inside a flow map/sequence and skip the quoting
    checks except for the quoting type.
    
    Closes adrienverge#516
    robherring authored and adrienverge committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    a962b41 View commit details
    Browse the repository at this point in the history