Skip to content

Feature request - Quote-type single should allow double-quoted strings with escape sequences #184

@o-l-a-v

Description

@o-l-a-v

Feature request

Yamllint has the same issue:

And unmerged suggestions for a fix:

Would be neat if ryl added support for this. :)

Reproduce

Sample config TOML:

[rules]
trailing-spaces = "enable"
[rules.quoted-strings]
quote-type = "single"
required = "only-when-needed"

Sample YAML:

---
# Ref: https://yamlscript.org/blog/2025-07-20/yaml-best-practices/
test:
  should-be-unquoted:
    - "double quotes"
    - 'single quotes'
  should-be-changed-to-single-quote:
    - "{double quote}"
  should-remain-double-quote:
    - "double\nquote"

Output from ryl v0.6.0:

PS > ryl "C:\Users\<redacted>\OneDrive\IT\Code\YAML\yaml string quoting test.yml" --config-file "C:\Users\<redacted>\OneDrive\IT\Code\.config\ryl.toml"
C:\Users\<redacted>\OneDrive\IT\Code\YAML\yaml string quoting test.yml
  5:7       error    string value is redundantly quoted with single quotes  (quoted-strings)
  6:7       error    string value is redundantly quoted with single quotes  (quoted-strings)
  8:7       error    string value is redundantly quoted with single quotes  (quoted-strings)
  10:7      error    string value is not quoted with single quotes  (quoted-strings)

PS > ryl --version
ryl 0.6.0
PS >

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions