The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

DESCRIPTION

This nitpicking rule re-quote simple strings with single-quote. For example, "coffee" becomes 'coffee'.

Simple strings ?

Simple strings is a subset of strings that satisfies all of these constraints:

    - is a string literal (not variable)
    - is quoted with: q, qq, double-quote ("), or single-quote (')
    - is a single-line string
    - has no interpolations inside
    - has no quote characters inside
    - has no sigil characters inside
    - has no metachar

For example, here's a short list of simple strings:

    - q<肆拾貳>
    - qq{Latte Art}
    - "Spring"
    - "Error: insufficient vespene gas"

While here are some counter examples:

    - "john.smith@example.com"
    - "'s-Gravenhage"
    - 'Look at this @{[ longmess() ]}'
    - q<The symbol $ is also known as dollor sign.>

Roughly speaking, given a string, if you can re-quote it with single-quote (') without changing its value -- then it is a simple string.