Skip to content

SC1111 - Don’t warn when quotes occur within string literal #3464

@twhb

Description

@twhb

For new checks and feature suggestions

Here's a snippet or screenshot that shows a potential problem:

#!/bin/sh
printf "error: “$var_name” has value “$var_value”\n"

Here's what shellcheck currently says:

SC1111 (warning): This is a unicode quote. […]

Here's what I wanted to see:

I’d like SC1111 to be able to recognize that this specific usage of Unicode quotes is valid and probably intentional, and produce no warning. Rewriting the code into something that SC1111 is happy with actually makes it worse, I think:

printf 'error: “'"$var_name"'” has value “'"$var_value"'”\n'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions